go-errors
Installation
SKILL.md
Go Errors
Errors are values. Treat them with the same care as any other return.
For the comprehensive reference, see references/error-handling.md.
The four rules
- Check every returned error. No exceptions for "this can't fail."
- Handle each error exactly once. Either log it OR return it; never both. Log-and-return causes duplicate log lines further up the stack.
- Wrap with context as the error travels up.
- Never panic in library code. Return an error and let the caller decide.