BigHugger
sk Skill · samber

golang-error-handling

Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For…

installs 8w
5,475
30-day movement
starts with the next reading
Related entries
1
Connections
1
Go

A Claude Code skill that loads Go error-handling conventions into an AI agent: error creation, wrapping with %w, errors.Is/As/Join, sentinel and custom errors, panic/recover, the single handling rule, slog structured logging, HTTP logging middleware, and samber/oops. It bundles reference files on error creation, handling, and wrapping and is aimed at making logs usable at scale with log aggregation tools.

Reach for it when you want an agent to write or audit Go error handling that follows one consistent, idiomatic style instead of ad-hoc patterns.

Use it to

  • Guide creation and wrapping of errors in Go code
  • Audit error handling across a codebase with parallel sub-agents
  • Set up slog structured logging and HTTP request logging middleware
  • Apply samber/oops for production error context
  • Enforce rules like never discarding errors with _

For Go developers using Claude Code or similar agent harnesses

Host repository
samber/cc-skills-golang
Version
1.3.1
Installs, lifetime
40k
Installs, 8 weeks
5,475
Allowed tools
Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent
Compatible with
Designed for Claude Code, Codex or similar harness, and for projects using Golang.
Licence
MIT
Invocable by
user
Host stars
3,261
Host language
Go
topicsgolangerror-handlingslogloggingsamber-oopsagent-skill