GO

golangci-lint

Used in 123 go projects (avg ★1555)

Go
Linter / Formatter
Default
Used by 123 projects

Details

Language / Topic
goGo
Category
Linter / Formatter

Rules

balanced
- Use golangci-lint as the standard Go linter. Configure in `.golangci.yml` at the project root.
- Run `golangci-lint run ./...` locally and in CI. Fix all reported issues before committing.
- Configure `.golangci.yml` with specific linters — enable `errcheck`, `govet`, `staticcheck`, `unused`, and `gosimple` at minimum.
- Enable useful linters: `errcheck`, `staticcheck`, `gosimple`, `govet`, `ineffassign`, `unused`.
- Add stricter linters gradually: `gocritic`, `revive`, `exhaustive`, `nilerr`, `prealloc`.
- Use `--fix` flag for auto-fixable issues. Use `--new-from-rev=HEAD~1` for checking only changed code.
- Set `issues.max-issues-per-linter: 0` and `issues.max-same-issues: 0` for comprehensive reporting.