What problem does it solve?
Provides concise, opinionated guidance to eliminate inconsistent, non-idiomatic, or fragile Go code by teaching patterns for error handling, concurrency, interface design, package organization, and performance that reduce bugs and improve maintainability.
Core Features & Use Cases
- Idiomatic Error Handling & Types: Recommendations for wrapping errors with context, using sentinel and custom error types, and checking errors with errors.Is and errors.As.
- Concurrency Patterns: Worker pools, context-based cancellation, errgroup coordination, graceful shutdown, and techniques to avoid goroutine leaks.
- Design & Organization: Advice on small focused interfaces, zero-value-friendly types, package layout (cmd/, internal/, pkg/), functional options, and embedding for composition.
- Use Case: Use this guidance to review a microservice repository that has leaking goroutines, unclear error propagation, and package-level globals to produce concrete refactors and tests that improve stability and readability.
Quick Start
Use the golang-patterns skill to review the provided Go code and recommend idiomatic refactors that improve error handling, concurrency safety, and package structure.