# GolangCI-Lint Configuration Standard # # Schema: golangci-lint v2 (the format installed by `golangci-lint-action` with # `version: latest`). v2 renamed `linters.disable-all` -> `linters.default`, moved # `linters-settings` under `linters.settings`, moved formatters into their own # `formatters` block, and folded `gosimple` and `stylecheck` into `staticcheck`. # A v1 config is rejected outright by a v2 binary — run `golangci-lint migrate` # if you are pinning an older release. version: "2" run: timeout: 5m issues-exit-code: 1 tests: true linters: default: none enable: # Correctness - errcheck - govet - ineffassign - staticcheck - unused - bodyclose - noctx - rowserrcheck - exhaustive # Security - gosec # Style & simplification - revive - gocritic - unconvert - unparam - prealloc - whitespace settings: govet: enable-all: true disable: # Field ordering is a deliberate readability choice; enable only in # memory-critical packages where struct padding has been measured. - fieldalignment revive: rules: - name: exported arguments: - checkPrivateReceivers - name: blank-imports - name: context-as-first-argument - name: dot-imports - name: error-return - name: error-strings - name: error-naming - name: if-return - name: increment-decrement - name: var-naming - name: package-comments - name: range - name: receiver-naming - name: time-naming - name: unexported-return - name: indent-error-flow - name: superfluous-else - name: unreachable-code gocritic: enabled-tags: - diagnostic - style - performance disabled-checks: - whyNoLint exhaustive: # A `default` clause must not satisfy the check: adding an enum variant # has to break the build, not fall through silently. default-signifies-exhaustive: false exclusions: # Do not lint generated files; do not inherit golangci-lint's default # exclusion presets, which silence several errcheck and gosec findings. generated: lax formatters: enable: - gofmt - goimports issues: max-issues-per-linter: 0 max-same-issues: 0