From golang
Detects optimal method to run golangci-lint in Go repositories (scripts, Makefile, direct, install) and reports structured issue summary.
How this skill is triggered — by the user, by Claude, or both
Slash command
/golang:lintThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill detects the best way to run golangci-lint in the current Go repository and executes it, reporting results in a structured summary.
This skill detects the best way to run golangci-lint in the current Go repository and executes it, reporting results in a structured summary.
Use this skill when:
golang:lint-fix)go.mod)golangci-lint installed, or the ability to install it (see Step 6 below)Try the following approaches in order. Proceed to Step 2 once any approach succeeds:
Check project documentation first - Read AGENTS.md or CLAUDE.md in the repository root (if they exist) and look for linting instructions (e.g., make lint, make verify, specific golangci-lint commands, or other linter commands). If found, use those instructions.
Check for lint scripts - Many repositories (especially OpenShift projects) have scripts that run golangci-lint in a containerized way with repo-specific configuration. Check for these patterns and run if found:
hack/go-lint.shhack/lint.shhack/verify-golangci-lint.shhack/verify-lint.shscripts/go-lint.shscripts/lint.sh*lint*.sh script in hack/ or scripts/ directoriesCheck the Makefile - Look for a make target like make lint or make verify-lint, and run it.
Run golangci-lint directly - Try: golangci-lint run
Try GOPATH binary - If golangci-lint was not found on PATH, try:
$(go env GOPATH)/bin/golangci-lint runInstall golangci-lint - If not installed, inform the user how to install it:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bingo install github.com/golangci/golangci-lint/cmd/golangci-lint@latestDuring the linter run:
.golangci.yml or .golangci.yaml, use it with golangci-lint run --config=<path>golangci-lint run --noconfigAfter running the linter:
Do not attempt to fix any issues - this skill is read-only.
Success with issues:
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)
No issues:
Code passes all linter checks (0 issues found)
Error: Installation instructions if golangci-lint could not be installed or run
golangci-lint command that was used, as callers (like golang:lint-fix) may need itgolangci-lint invocation (e.g., --tests, --concurrency 4)--fix; if the user wants fixes, direct them to the /golang:lint-fix commandnpx claudepluginhub openshift-eng/ai-helpers --plugin golangConfigures golangci-lint with best-practice .golangci.yml, interprets lint output and nolint directives, and selects linters for Go projects.
Sets up golangci-lint for Go projects with recommended linters (errcheck, goimports, revive, govet, staticcheck) for code quality and static analysis. Includes config, running instructions, and CI/CD integration.
Applies Go best practices for performance, modern syntax, generics, patterns, testing, error handling, and concurrency when writing or reviewing Go code.