Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In our example, we `panic` in `main` instead of the function `foo`. The point that this was demonstrating was that the caller of the function has the choice of panicking rather than `foo` itself. Unfortunately, this causes confusion for readers modeling their `main()` after this code, because the "good" example still panics. This reduces confusion here by having `main` handle the `error` with an `os.Exit`. Note that this moves argument handling into `foo` because placing it in `main` is not very testable.
- Loading branch information