
Description
golang-error-handling is an agent skill from the samber cc-skills-golang collection that guides a coding agent to write idiomatic, debuggable error handling in Go. It covers creating errors, wrapping them with %w to keep context, checking them with errors.Is and errors.As, combining them with errors.Join, defining custom error types and sentinel errors, and using panic and recover only where they belong. It also sets out a single-handling rule, so an error is either handled or returned with context, never both logged and returned, and it asks for structured logging. The skill works in three modes. Coding mode applies the practices while new code is written. Review mode checks a pull request's error changes for swallowed errors, missing wrapping context, log-and-return pairs and panic misuse. Audit mode runs up to five parallel sub-agents across an existing codebase, each covering one category: creation, wrapping, the single-handling rule, panic and recover, and structured logging. The skill is listed on skills.sh, where the page shows install counts, GitHub stars and security audit results. Install it with npx skills add https://github.com/samber/cc-skills-golang --skill golang-error-handling.…
Highlights
- Wrapping errors with %w for context
- errors.Is, errors.As and errors.Join
- Custom error types and sentinel errors
- Single-handling rule against log-and-return
- Coding, review and audit modes
- Installs from skills.sh
Ratings & Reviews
No ratings yet
Be the first to rate golang-error-handling.
People also visit
golang-error-handling FAQ
What does this skill cover?
Idiomatic Go error handling: creating and wrapping errors, errors.Is and errors.As, errors.Join, custom and sentinel errors, and panic and recover.
What are the three modes?
Coding mode for writing new error handling, review mode for pull request diffs, and audit mode for auditing a whole codebase with parallel sub-agents.
What is the single-handling rule?
An error should either be handled or returned with added context, not logged and returned at the same time.
How do I install it?
Run npx skills add https://github.com/samber/cc-skills-golang --skill golang-error-handling.
What are the security audit results?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
How popular is it?
The page shows about 41.4K installs, and the cc-skills-golang repository has 3.5K GitHub stars.
What are the best golang-error-handling alternatives?
Popular alternatives to golang-error-handling include golang-code-style, golang-testing and golang-patterns. See all golang-error-handling alternatives




