What problem does it solve?
Adding a new custom Go static analysis linter to the gh-aw repository requires knowing the correct package layout, analyzer registration, test conventions, and build commands, which are easy to get wrong without guidance.
Core Features & Use Cases
- Linter Scaffolding Guidance: Directs you to create a package under
pkg/linters/<linter-name>/, export an Analyzer, and register it in cmd/linters/main.go for the multichecker binary.
- Testing Workflow: Explains how to write
analysistest-based tests with fixtures under testdata/src/... and run them with go test ./pkg/linters/<linter-name>/....
- Coverage-Aware Perf Gating: Shows how to gate performance-related diagnostics on hot code paths using the shared
pkg/linters/internal/coverage package and a coverage profile.
- Use Case: You want to add a linter that flags unnecessary allocations, but only on code paths exercised by tests. Follow the coverage-gating steps to register a
-hot-threshold flag and call coverage.ShouldApply before reporting diagnostics.
Quick Start
Ask the agent to add a new custom Go linter named after your rule, register it in the multichecker, and run its package tests.