Canonical guidance

Use when

Avoid

Preferred pattern

func main() {
	flag.Parse()
	if err := run(flag.Args()); err != nil {
		log.Fatal(err)
	}
}

Anti-pattern

Explanation: This is tempting because it feels convenient, but it makes CLI behavior harder to validate and test.

Why

Related pages

Sources