version: "2" run: modules-download-mode: readonly linters: enable: - asasalint - asciicheck - bidichk - bodyclose - containedctx - contextcheck - cyclop - dupl - durationcheck - errname - errorlint - exhaustive - forbidigo - gocognit - goconst - gocritic - gocyclo - godox - gomoddirectives - gomodguard_v2 - goprintffuncname - gosec - grouper - importas - makezero - misspell - nakedret - nestif - nilerr - nilnil - noctx - nolintlint - nosprintfhostport - predeclared - promlinter - reassign - revive - rowserrcheck - sqlclosecheck - testpackage - thelper - tparallel - unconvert - unparam - usestdlibvars - wastedassign - whitespace settings: cyclop: max-complexity: 20 dupl: threshold: 300 goconst: # Repeated literals in tests are fixture data ("1.0.0", "Test server", ...); # hoisting them into constants hurts readability more than it helps. ignore-tests: true gocognit: min-complexity: 51 nestif: min-complexity: 10 exclusions: generated: lax presets: - comments - common-false-positives - legacy - std-error-handling rules: # httptest.NewRequest is idiomatic in tests; noctx is not useful there. - path: _test\.go linters: - noctx paths: - third_party$ - builtin$ - examples$ formatters: enable: - gofmt exclusions: generated: lax paths: - third_party$ - builtin$ - examples$