Go Lint
Run golangci-lint to check Go code quality and report issues.
Discovery
Find how to run the linter using this cascade — stop at the first match:
- CLAUDE.md / AGENTS.md: Check for instructions about linting. If a lint command is documented, use it.
- Makefile targets: Check for
lintorverify-linttargets (grep -E "^(lint|verify-lint):" Makefile). If found, runmake lintormake verify-lint. - Direct invocation: Run
golangci-lint run ./...
If golangci-lint Is Not Found
Report that golangci-lint is not available and direct the user to the installation docs. Do not auto-install.
Output
Use this format when issues are found:
Found 15 issues:
- goconst: 5 issues
- staticcheck: 4 issues
- gocyclo: 3 issues
- revive: 3 issues
Example issues:
- pkg/api/handler.go:42: string "application/json" has 3 occurrences (goconst)
- pkg/utils/helper.go:87: cyclomatic complexity 15 of function ProcessData (gocyclo)
When clean:
Code passes all linter checks (0 issues found)
Constraint
This skill is read-only. Never modify files or attempt fixes. Use the golang:lint-fix skill for that.
If the user passes additional flags, chain them to the golangci-lint invocation (e.g., --tests, --concurrency 4).