Skip to content

Commit

Permalink
fix: Duplicate error message from cobra init boilerplates (#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
ANGkeith authored Dec 7, 2021
1 parent 6f84ef4 commit 1beb476
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 1beb476

Please sign in to comment.