INNER CODE UNIT · Go
main
apache/camel-k · cmd/kamel/main.go:32
func main() {
ctx, cancel := context.WithCancel(context.Background())
// Cancel ctx as soon as main returns
defer cancel()
// Add modeline options to the command
rootCmd, _, err := cmd.NewKamelWithModelineCommand(ctx, os.Args)
exitOnError(err)
err = rootCmd.Execute()
exitOnError(err)
}
func exitOnError(err error) {
if err != nil {
os.Exit(1)
}