Yep, you're correct. I might even prefer returning an error that if non-nil is printed to stderr and os.Exit(1) is called. That would make this code testable.