Better instructions for the execute inside main()

This commit is contained in:
Steve Francia 2015-11-20 17:37:20 -05:00
parent 4e18e0c2bf
commit e22a0c9315

View file

@ -156,7 +156,10 @@ package main
import "{pathToYourApp}/cmd" import "{pathToYourApp}/cmd"
func main() { func main() {
RootCmd.Execute() if err := cmd.RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(-1)
}
} }
``` ```
@ -289,7 +292,10 @@ package main
import "{pathToYourApp}/cmd" import "{pathToYourApp}/cmd"
func main() { func main() {
RootCmd.Execute() if err := cmd.RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(-1)
}
} }
``` ```