Skip to content

Instantly share code, notes, and snippets.

@wayneashleyberry
Created August 6, 2018 10:55
Show Gist options
  • Save wayneashleyberry/d4f4bc495505fbac1000e0ff7042c27a to your computer and use it in GitHub Desktop.
Save wayneashleyberry/d4f4bc495505fbac1000e0ff7042c27a to your computer and use it in GitHub Desktop.
Go command to run an application
// Command contains the app command
var Command = &cobra.Command{
Use: "app",
Short: "Run the application",
Run: func(cmd *cobra.Command, args []string) {
var s app.Specification
envconfig.MustProcess("", &s)
if err := probe.Create(); err != nil {
panic(err)
}
app.Run(s)
if err := probe.Remove(); err != nil {
panic(err)
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment