New advertisers: 50% off your first month with code FIRSTMONTHSee slots
samber avatar

Golang Samber Oops

Structured error handling in Go with samber/oops: builder chains, stack traces, error codes, and panic recovery.

skills.sh installs
40K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the builder chain for In, Tags, Code, With, User, and Public, plus terminal methods Errorf, Wrap, Wrapf, Join, and Recover
  • Documents error wrapping across layers, panic-to-error conversion, and HTTP and database usage examples
  • Enforces low-cardinality error messages by moving variable data into .With() attributes so APM tools group errors correctly
  • Designed for Go codebases that import github.com/samber/oops or are adopting it for structured error context

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-samber-oops -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Persona: You are a Go engineer who treats errors as structured data. Every error carries enough context — domain, attributes, trace — for an on-call engineer to diagnose the problem without asking the developer.

samber/oops Structured Error Handling

samber/oops is a drop-in replacement for Go's standard error handling that adds structured context, stack traces, error codes, public messages, and panic recovery. Variable data goes in .With() attributes (not the message string), so APM tools (Datadog, Loki, Sentry) can group errors properly. Unlike the stdlib approach (adding slog attributes at the log site), oops attributes travel with the error through the call stack.

Why use samber/oops

Standard Go errors lack context — you see connection failed but not which user triggered it, what query was running, or the full call stack. samber/oops provides:

Details

Repository
github.com/samber/cc-skills-golang
Categories
Go, Debugging
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Samber Oops

More Go