mirror of
https://github.com/spf13/cobra
synced 2025-05-05 21:07:24 +00:00
fix: Duplicate error message from cobra init boilerplates
This commit is contained in:
parent
de187e874d
commit
82992eb063
1 changed files with 4 additions and 1 deletions
|
@ -52,7 +52,10 @@ to quickly create a Cobra application.` + "`" + `,
|
||||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||||
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
||||||
func Execute() {
|
func Execute() {
|
||||||
cobra.CheckErr(rootCmd.Execute())
|
err := rootCmd.Execute()
|
||||||
|
if err != nil {
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue