golang-lint
Linting best practices and golangci-lint configuration for Golang projects — running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and selecting linters. Use when configuring golangci-lint, asking about lint warnings or nolint suppressions, setting up code quality tooling, or choosing linters. Also use when the user mentions golangci-lint, go vet, staticcheck, or revive.
Security Assessment
About golang-lint
The golang-lint skill provides comprehensive support for linting Go code using golangci-lint, the industry-standard aggregator of over 100 linters for Go projects. This skill helps developers maintain code quality by guiding them in configuring, running, and interpreting linting results, ensuring adherence to best practices and reducing the likelihood of introducing subtle bugs or style inconsistencies. By integrating linting into the development workflow rather than treating it as a post-hoc step, it promotes consistent, maintainable, and high-quality Go codebases.
The skill offers a range of capabilities, including configuring the .golangci.yml file with recommended production-ready settings, selecting and enabling specific linters, running linters in parallel, automatically fixing fixable issues, and formatting code. It also assists with interpreting lint output and provides guidance on suppressing lint warnings responsibly using //nolint directives with proper justification. Users can run individual linters, list available linters, enable verbose output, and leverage best practices for suppressing warnings, including enforcement by the nolintlint linter. The skill accommodates multiple modes of operation: setup, coding, and interpret/fix, allowing both real-time and large-scale legacy code maintenance workflows.
This skill is ideal for Go developers, code quality engineers, and teams implementing continuous integration workflows who want to enforce strict code quality standards. Use cases include setting up and maintaining golangci-lint configurations, diagnosing and resolving lint warnings, performing automated fixes, and ensuring code style consistency across large projects. It's particularly valuable for projects using golangci-lint, go vet, staticcheck, or revive, enabling developers to integrate high-quality linting into their everyday development practices efficiently.
FAQ
How do I run all linters on my Go project?
Use the command `golangci-lint run ./...` to execute all configured linters in the project directory. For automatic fixes where supported, append the `--fix` flag.
Which linters are included and how are they configured?
The recommended `.golangci.yml` configuration includes a production-ready setup with 33 linters enabled. Detailed per-linter descriptions, categories, and usage guidance are available in the linter reference documentation.
Can I suppress lint warnings if necessary?
Yes, but `//nolint` directives should be used sparingly. Always specify the linter name and provide a justification comment. Security-related linters should almost never be suppressed without strong reasons.
What tools and binaries does this skill require?
It requires `go` and `golangci-lint` binaries. Installation can be done via Homebrew with the `golangci-lint` formula.
Is this skill compatible with CI workflows and AI coding agents?
Yes, it is designed to work with Claude Code or similar AI coding agents and is intended for projects using Go, supporting CI integration and automated linting workflows.
Install golang-lint
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
samber/cc-skills-golang