What problem does it solve?
This Skill enforces modern Go programming standards, ensuring code quality, maintainability, and robustness for Go 1.25 and later versions.
Core Features & Use Cases
- Modern Go Features: Utilizes error wrapping (
fmt.Errorf("%w", err)) and errors.Is/As for robust error handling.
- Testing Standards: Implements table-driven tests with
t.Run() and black-box testing conventions for *_test.go files.
- Linting & Analysis: Integrates
golangci-lint with essential linters like errcheck, govet, staticcheck, gosec, and complexity checks (≤25 cyclomatic complexity).
- Code Coverage: Aims for 80%+ coverage on business logic and uses
go test -race for concurrency bug detection.
- Package Structure: Adheres to standard Go project layout (
cmd/, internal/, pkg/).
- Naming Conventions: Follows PascalCase for types, camelCase for variables, and SCREAMING_SNAKE_CASE for constants.
- Context Propagation: Ensures
Context.Context is the first parameter in I/O functions and respects cancellation.
- Structured Logging: Uses
zerolog for efficient, structured logging.
- Use Case: Ensure all new Go projects adhere to the latest industry best practices for error handling, testing, and code structure, reducing technical debt and improving collaboration.
Quick Start
Apply the Go 1.25+ Standards to a Go project to ensure best practices are followed.