This guide helps you write better Go code by using proper error handling. You will learn how to create errors, wrap them with context, and inspect error chains. Idiomatic Go error handling makes your programs more reliable and easier to debug.
Follow best practices like never discarding errors, using %w for wrapping, and logging with slog. Avoid common mistakes such as panicking for expected errors or logging and returning the same error.
Apply these rules in your Go projects to produce clean, production-ready error code. Use tools like errors.Is and errors.As to inspect errors correctly.
Global
mkdir -p ~/.claude/skills/golang-error-handlingProject
mkdir -p .claude/skills/golang-error-handlingSource Repository
Typescript Advanced Typeswshobson/agents
Master advanced TypeScript types for safer and more flexible code
Python Executorqu-skills/skills
Execute Python code safely with 100+ libraries for data, scraping, and media
Golang Performancesamber/cc-skills-golang
Speed up your Go code using proven patterns for allocation reduction and CPU efficiency
Golang Design Patternssamber/cc-skills-golang
Idiomatic Go patterns for clean constructors error handling and graceful shutdown
Golang Concurrencysamber/cc-skills-golang
Write safe Go concurrency with goroutines, channels, and sync primitives
Golang Data Structuressamber/cc-skills-golang
Optimize Go data structures for speed and memory efficiency with internals knowledge
Golang Contextsamber/cc-skills-golang
Master Go context for cancellations, timeouts, and request values
Golang Popular Librariessamber/cc-skills-golang
Go library recommendations that focus on standard library, simplicity, and performance