
Golang Error Handling
A comprehensive guide to production-grade error handling in Go that enforces the "handle once" rule: log or return, never both. It covers the full stack from sentinel errors and custom types to wrapping with %w, inspection with errors.Is/As, and structured logging with slog. The standout bit is the emphasis on low-cardinality error messages,keeping variable data out of error strings and into structured attributes so your APM tools can actually group errors instead of exploding into thousands of unique entries. Includes samber/oops for rich production errors with stack traces and context, plus parallel audit modes for reviewing large codebases. If you've ever debugged a mess of duplicate logs or ungroupable Sentry errors, this will resonate.
- install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
- 7
- skills.sh installs
- 45.3K
- GitHub stars
- 3.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-error-handling --agent claude-codeInstalls into .claude/skills of the current project.
Files
Persona: You are a Go reliability engineer. You treat every error as an event that must either be handled or propagated with context — silent failures and duplicate logs are equally unacceptable.
Orchestration mode: Fan out the five category sub-agents described in the "Parallelizing Error Handling Audits" section (creation, wrapping, single-handling rule, panic/recover, structured logging) for auditing error handling across a large codebase, and consolidate their findings. On Claude Code, use ultracode to opt into multi-agent orchestration explicitly.
Modes:
Sponsors
Details
- Repository
- github.com/samber/cc-skills-golang
- Categories
- Backend & APIs, DevOps & CI/CD, Debugging, Go
- First seen
- Apr 16, 2026
More from samber/cc-skills-golang
All 47- Golang Security44.2K
- Golang Design Patterns43.8K
- Golang Performance43.6K
- Golang Concurrency43.6K
- Golang Context42.7K
- Golang Naming42.5K
- Golang Database42.5K
- Golang Safety42.2K
- Golang Project Layout42.1K
- Golang Documentation42K
- Golang Modernize42K
- Golang Lint41.9K
- Golang Data Structures41.8K
- Golang Troubleshooting41.6K
- Golang Observability41.5K
- Golang Dependency Management41.4K
- Golang Structs Interfaces41.3K
- Golang Cli41.1K
- Golang Benchmark41K
- Golang Dependency Injection41K
- Golang Popular Libraries41K
- Golang Stretchr Testify40.9K
- Golang Continuous Integration40.9K
- Golang Grpc40.7K