use-modern-go
Installation
SKILL.md
Use Modern Go
Produce idiomatic Go code that is easy to evolve, safe under load, and operationally predictable. Never add compatibility shims for older Go versions unless the module explicitly targets one.
Baseline
- Go 1.26+ unless the repository explicitly declares an older module target.
- Detect version:
go list -m -f '{{.GoVersion}}' 2>/dev/null || awk '/^go /{print $2; exit}' go.mod - Priorities in order: clarity, simplicity, concision, maintainability, consistency.
Reference Routing
Load only what the task needs:
- references/go-style-and-design.md — naming, package/API design, errors, context, observability, security, data semantics, dependencies.
- references/go-testing-and-concurrency.md — tests, fuzzing, benchmarks, race safety, goroutine lifecycle, cancellation, cleanup.
- references/modern-go-features.md — version-gated features from Go 1.13 through 1.26+.
- references/source-basis.md — canonical source provenance.