Exit with error code in go?
I do something along these lines in most of my real main packages, so that the return err convention is adopted as soon as possible, and has a proper termination: func main() { if err := run(); err != nil { fmt.Fprintf(os.Stderr, “error: %v\n”, err) os.Exit(1) } } func run() error { err := something() … Read more