convox / convox

Exit inside non-main function RVV-A0003
Anti-pattern
Major
18 hours agoa year old
calls to os.Exit only in main() or init() functions
41	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
42	r.Shutdown(ctx)
43
44	os.Exit(0)45}
calls to os.Exit only in main() or init() functions
46
47func usage() {
48	fmt.Fprintf(os.Stderr, "usage: generate <controllers|routes>\n")
49	os.Exit(1)50}
calls to os.Exit only in main() or init() functions
43	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
44	s.Shutdown(ctx)
45
46	os.Exit(0)47}