Install any skill in seconds. Free to start, no credit card required.
Get Started Free →samber/golang-samber-oops
Structured error handling in Golang with samber/oops — error builders, stack traces, error codes, error context, error wrapping, error attributes, user-facing vs developer messages, panic recovery, and logger integration. Apply when using or adopting samber/oops, or when the codebase already imports github.com/samber/oops.
Passed 22 of 24 test cases with the skill, and 9 of 24 without it.
and 12 more in the full report
14 fixed8 passed either way1 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 14 test cases the skill fixed. Same model, same prompt, with and without the skill.
In a multi-tenant Go service, when an operation fails for an organization, we want to record the tenant ID alongside metadata like tenant plan tier. Which error builder method attaches tenant identity and attributes?
| Checked | Without skill | With skill |
|---|---|---|
| Attaches tenant identifiers and tenant-specific attributes using .Tenant(...) | Missed | Passed |
The instructions your model reads when the skill loads.
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 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.
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:
.With() attributes, not the message string, so APM tools group errors properlyThis skill is not exhaustive — refer to library documentation and code examples for more information:
samber/cc-skills-golang@golang-pkg-go-dev skill (godig), preferred over Context7 for Go package facts.samber/cc-skills-golang@golang-gopls skill (gopls).All oops errors use a fluent builder pattern:
err := oops.
In("user-service"). // domain/feature
Tags("database", "postgres"). // categorization
Code("network_failure"). // machine-readable identifier
User("user-123", "email", "[email protected]"). // user context
With("query", query). // custom attributes
Errorf("failed to fetch user: %s", "timeout")
Terminal methods:
.Errorf(format, args...) — create a new error.Wrap(err) — wrap an existing errortest cases passed, vs 9 / 24 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.