New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Consistent golangci-lint setup for Go projects, with a verified v2 baseline config and linter selection guidance.

skills.sh installs
1.4K
GitHub stars
196
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers setup, running, nolint rules, and CI or pre-commit integration for golangci-lint v2
  • Includes a scripts/setup-lint.sh generator, an assets/golangci.yml baseline, and a table of minimum and additional linters
  • Requires //nolint:linter // reason directives with a justification and rejects bare //nolint
  • Designed for Go projects that need consistent static analysis in local development and CI

Install

$ npx -y skills add cxuu/golang-skills --skill go-linting -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

  1. Create .golangci.yml with scripts/setup-lint.sh or copy assets/golangci.yml
  2. Run golangci-lint run ./...
  3. If errors appear, fix them category by category (formatting first, then vet, then style)
  4. 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:

Details

Repository
github.com/cxuu/golang-skills
Categories
Go, Code Review & Quality
First seen
May 16, 2026

More from cxuu/golang-skills

All 20

Similar to Go Linting

More Go