What problem does it solve?
This Skill helps developers write robust, efficient, and maintainable Go code by providing a collection of idiomatic patterns and best practices.
Core Features & Use Cases
- Idiomatic Patterns: Offers guidance on writing clear and direct Go code, following best practices for data structures, interfaces, and concurrency.
- Error Handling: Demonstrates patterns for wrapping and handling errors effectively.
- Concurrency: Explains patterns for managing goroutines, context handling, and graceful shutdowns.
- Interface Design: Guidelines for creating small, focused interfaces and embedding for composition.
- Struct Design: Insights on the Functional Options Pattern and avoiding global state.
- Memory and Performance: Techniques for preallocating slices, using sync.Pool, and avoiding string concatenation in loops.
- Go Tooling Integration: Commands for building, running, testing, and formatting Go code, including linter configurations.
- Quick Reference: A concise list of idioms and anti-patterns to remember.
Quick Start
Use the golang-patterns skill to learn the Go idiom 'Functional Options Pattern' and see how it improves the initialization of struct fields.