Skip to content

Commit 1beb476

Browse files
authored
fix: Duplicate error message from cobra init boilerplates (#1463)
1 parent 6f84ef4 commit 1beb476

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cobra/tpl/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ to quickly create a Cobra application.` + "`" + `,
6767
// Execute adds all child commands to the root command and sets flags appropriately.
6868
// This is called by main.main(). It only needs to happen once to the rootCmd.
6969
func Execute() {
70-
cobra.CheckErr(rootCmd.Execute())
70+
err := rootCmd.Execute()
71+
if err != nil {
72+
os.Exit(1)
73+
}
7174
}
7275
7376
func init() {

0 commit comments

Comments
 (0)