Created
August 6, 2018 10:55
-
-
Save wayneashleyberry/d4f4bc495505fbac1000e0ff7042c27a to your computer and use it in GitHub Desktop.
Go command to run an application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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