Error handling, panic, and recovery: Go course | Zoonk
14. Error handling, panic, and recovery
Represent expected failures with error values, wrap causes, inspect error chains, and create typed or sentinel errors when callers need decisions. Reserve panic and recover for appropriate boundary and invariant failures.