Designing Errors Out of Your Go CLI
go
dev.to
Most Go CLIs have too many error checks. Not because error handling is wrong — because the errors themselves are wrong. I read the Power of Go Tools by John Arundel. Based on his book, I audited a 50,000-line Go CLI for functions that return errors unnecessarily. The result: 10 functions refactored, 50+ if err != nil checks eliminated, and the remaining error checks now mean something. This is John Ousterhout's philosophy from A Philosophy of Software Design: don't handle errors better — desig