Skip to content
Myr

Better instructions for the execute inside main()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Steve Francia · committed by Steve Francia · parent 4e18e0c · Browse files · 1 file+8 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−2 removed

  • other:+8 added−2 removed

1 file+8 added−2 removed

modified:README.md+8 added-2 removed
154 unmodified lines
155156import "{pathToYourApp}/cmd"157158func main() {159 RootCmd.Execute()159 if err := cmd.RootCmd.Execute(); err != nil {160 fmt.Println(err)161 os.Exit(-1)162 }163}164```165166## Using the Cobra Generator
124 unmodified lines
291292import "{pathToYourApp}/cmd"293294func main() {292 RootCmd.Execute()295 if err := cmd.RootCmd.Execute(); err != nil {296 fmt.Println(err)297 os.Exit(-1)298 }299}300```301302
567 unmodified lines