Skip to content

Commit

Permalink
fix: Duplicate error message from cobra init boilerplates (spf13#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
ANGkeith authored and umarcor committed Nov 5, 2021
1 parent 432319a commit 4e66e61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cobra/tpl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ to quickly create a Cobra application.` + "`" + `,
// 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.
func Execute() {
cobra.CheckErr(rootCmd.Execute())
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
Expand Down

0 comments on commit 4e66e61

Please sign in to comment.