
Go Linting
This is a practical guide to setting up golangci-lint with opinionated but sensible defaults. It recommends five core linters (errcheck, goimports, revive, govet, staticcheck) and emphasizes consistent linting over any particular toolset. The setup script generates a working config in one command, and the documentation covers nolint directives, CI integration, and when to add security or complexity checks. The advice is clearly derived from the Uber Style Guide, which means it's battle-tested on large codebases. If you're starting a Go project or tired of inconsistent linting across your repos, this gives you a solid baseline without drowning you in 50+ linter options.
- skills.sh installs
- 1.3K
- GitHub stars
- 193
- last updated
- Aug 21, 2026
Install
$ npx -y skills add cxuu/golang-skills --skill go-linting --agent claude-codeInstalls into .claude/skills of the current project.
Files
Go Linting
Core Principle
More important than any "blessed" set of linters: lint consistently across a codebase.
Consistent linting helps catch common issues and establishes a high bar for code quality without being unnecessarily prescriptive.
Resource Routing
scripts/setup-lint.sh- Run when generating a.golangci.yml, validating the first lint pass, or producing JSON metadata.assets/golangci.yml- Use as the v2 golangci-lint baseline for established projects.
Setup Procedure
- Create
.golangci.ymlwithscripts/setup-lint.shor copyassets/golangci.yml - Run
golangci-lint run ./... - If errors appear, fix them category by category (formatting first, then vet, then style)
- Re-run until clean
After generating .golangci.yml, run golangci-lint config verify --config .golangci.yml
to verify the configuration schema before relying on lint results.
Minimum Recommended Linters
These linters catch the most common issues while maintaining a high quality bar:
Sponsors
Details
- Repository
- github.com/cxuu/golang-skills
- Categories
- DevOps & CI/CD, Git & Pull Requests, Code Review & Quality, Automation & Workflows, Sales & Marketing, Go
- First seen
- May 16, 2026
More from cxuu/golang-skills
All 20- Go Concurrency1.3K
- Go Interfaces1.3K
- Go Documentation1.3K
- Go Style Core1.3K
- Go Performance1.3K
- Go Context1.3K
- Go Naming1.3K
- Go Defensive1.3K
- Go Packages1.3K
- Go Data Structures1.3K
- Go Functional Options1.3K
- Go Control Flow1.3K
- Go Logging1.1K
- Go Functions1.1K
- Go Generics1.1K
- Go Declarations1.1K
- Go Code Review1.8K
- Go Testing1.4K
- Go Error Handling1.3K