What problem does it solve?
It helps you structure production Go code consistently by recommending idiomatic design patterns that reduce hidden complexity and runtime surprises.
Core Features & Use Cases
- Functional options over builders: Create constructor APIs that scale as configuration grows, with options that can validate and fail fast.
- Safer initialization and lifecycle: Avoid
init() for hidden side effects, ensure resource cleanup with defer Close() right after opening, and prefer graceful shutdown/resilience practices.
- Robust error and resource handling: Handle error cases early, use timeouts for external calls, retry responsibly (checking context cancellation), and limit unbounded resources to prevent crashes.
- Testable architecture and dependency injection: Design for testability by accepting interfaces and injecting dependencies rather than relying on implicit globals.
Quick Start
Use this skill when you are implementing a Go service component and want guidance on which idiomatic pattern fits—especially for constructor APIs (functional options), validation/error flow, and graceful shutdown/resource lifecycle.