golang

Installation
Summary

Production Go code patterns covering error handling, concurrency, naming, testing, and performance.

  • Comprehensive error handling guidance: return errors instead of panicking, use error wrapping with %w for inspection and %v for boundaries, join multiple errors with errors.Join, and handle errors once at the appropriate level
  • Concurrency best practices: unbuffered or size-1 channels, document goroutine lifetimes, prefer errgroup.Group for concurrent operations, and use typed atomics from sync/atomic
  • Naming conventions: MixedCaps always, consistent initialisms (URL not Url), short names for limited scope, one or two-letter receiver names, and avoid repeating package names in identifiers
  • Testing patterns: table-driven tests with parallel execution, use go-cmp for comparisons, synctest for deterministic concurrent testing (Go 1.25+), and verify interface compliance at compile time
  • Performance tips: preallocate slices and maps with known capacity, use strings.Builder for concatenation, prefer strconv over fmt, and leverage standard library slices and maps packages
SKILL.md

Go Best Practices

Production patterns from Google, Uber, and the Go team. Updated for Go 1.25.

Sub-skills: skills/go-error-handling, skills/go-concurrency, skills/go-testing, skills/go-performance, skills/go-code-review, skills/go-linting, skills/go-project-layout, skills/go-security. Deep-dive references in references/.

Core Principles

Readable code prioritizes these attributes in order:

  1. Clarity: purpose and rationale are obvious to the reader
  2. Simplicity: accomplishes the goal in the simplest way
  3. Concision: high signal to noise ratio
  4. Maintainability: easy to modify correctly
  5. Consistency: matches surrounding codebase

Error Handling

Installs
419
GitHub Stars
6
First Seen
Jan 21, 2026