golang-error-handling

This skill provides a framework for idiomatic Go error handling, including creation, wrapping, inspection, and structured logging. It defines best practices for maintaining debuggable, production-ready code and includes instructions for auditing codebases using parallel sub-agents.

33.6K
Installs
4
Use cases
5/10
Quality

Is golang-error-handling safe to install?

Review the source first

Review the source first: our audit of golang-error-handling's source files found 3 shell commands, 0 external URLs, file reads and writes (high risk). Every command and URL listed appears verbatim in the skill's source. The skill requires the 'go' binary and allows the agent to execute shell commands via Bash, including golangci-lint and git, which enables modification of the local codebase.

How we audit skills: our security review methodology.

Who is this skill for?

Go developers and reliability engineers using Claude Code or similar AI coding agents.

What can you do with it?

  • Writing new error handling code following Go best practices.
  • Reviewing pull requests for swallowed errors, missing context, or panic misuse.
  • Auditing existing codebases for error handling violations using parallel sub-agents.
  • Implementing structured logging with slog and samber/oops.

How good is this skill?

Quality score: 5/10. The skill provides clear, actionable, and idiomatic Go guidelines. It includes specific instructions for agent orchestration and audit modes.

What does the skill file contain?

SKILL.md
**Persona:** You are a Go reliability engineer. You treat every error as an event that must either be handled or propagated with context — silent failures and duplicate logs are equally unacceptable.

**Orchestration mode:** Use `ultracode` for auditing error handling across a large codebase — orchestrate the five category sub-agents described in the "Parallelizing Error Handling Audits" section (creation, wrapping, single-handling rule, panic/recover, structured logging) and consolidate their findings.

**Modes:**

- **Coding mode** — writing new error handling code. Follow the best practices...

Frequently asked questions

What is the single handling rule?

Errors must be either logged or returned, but never both, to prevent duplicate logs in aggregators.

How should I wrap errors?

Use fmt.Errorf with the %w verb to add context while preserving the error chain.

When should I use panic?

Never use panic for expected error conditions. Reserve it for truly unrecoverable states.

How do I audit a large codebase for error handling?

Use the audit mode to orchestrate up to five parallel sub-agents, each targeting a specific category: error creation, wrapping, the single handling rule, panic/recover, and structured logging.

Data sourced from samber/cc-skills-golang on GitHub. Install counts from skills.sh. The summary and security audit are derived from the skill's source files: every command and URL listed appears verbatim in the source.

Related skills