Skip to content

Instantly share code, notes, and snippets.

@andersonpem
Last active September 19, 2025 15:26
Show Gist options
  • Select an option

  • Save andersonpem/a121e198f594b8a554a392f99a9c99a9 to your computer and use it in GitHub Desktop.

Select an option

Save andersonpem/a121e198f594b8a554a392f99a9c99a9 to your computer and use it in GitHub Desktop.
GolangCI YAML config compliant with version 2.x
version: 2
run:
timeout: 5m
tests: true
issues-exit-code: 1
allow-parallel-runners: true
go: "1.25"
output:
format: colored-line-number
issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
presets:
- bugs
- complexity
- performance
- style
- format
enable:
- gosec
- gocritic
- revive
- unconvert
- unparam
- misspell
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- copyloopvar
- cyclop
- decorder
- depguard
- dogsled
- durationcheck
- err113
- errchkjson
- errorlint
- exhaustive
- exhaustruct
- gocognit
- goconst
- gocyclo
- godot
- godox
- goheader
- gomoddirectives
- gomodguard
- goprintffuncname
- importas
- interfacebloat
- ireturn
- loggercheck
- maintidx
- makezero
- mirror
- mnd
- musttag
- nakedret
- nestif
- nilerr
- nlreturn
- noctx
- nolintlint
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- recvcheck
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- tagliatelle
- tparallel
- testableexamples
- testpackage
- thelper
- usetesting
- wastedassign
- whitespace
- wrapcheck
- zerologlint
disable:
- wsl
formatters:
enable:
- gofmt
- gofumpt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment