AI AGENT ADDONS

Golang Error Handling

samber/cc-skills-golang
Programming Languages
34,783installs

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.

Add Golang Error Handling skill to your workflow

Global

mkdir -p ~/.claude/skills/golang-error-handling

Project

mkdir -p .claude/skills/golang-error-handling

Source Repository

Stars
2,322
Forks
149
Watchers
2,322
License
MIT
Last Push
28 days ago
Created
4 months ago