golangci-lint: enable modernize linter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-03-17 09:47:07 +01:00
parent a5cfa74d5e
commit bded42c57d

View File

@@ -1,11 +1,12 @@
version: "2" version: "2"
linters: linters:
enable: enable:
- copyloopvar # Checks for loop variable copies in Go 1.22+ - copyloopvar # Checks for loop variable copies in Go 1.22+
- depguard # Checks for dependencies that should not be (re)introduced. See "settings" for further details. - depguard # Checks for dependencies that should not be (re)introduced. See "settings" for further details.
- dupword # Checks for duplicate words in the source code - dupword # Checks for duplicate words in the source code
- gosec - gosec
- misspell - misspell
- modernize # Suggests modernizations to Go code; see https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize
- nolintlint - nolintlint
- revive - revive
- unconvert - unconvert
@@ -40,6 +41,11 @@ linters:
- G301 - G301
- G302 - G302
- G304 - G304
modernize:
disable:
# TODO(thaJeztah): enable testingcontext once github.com/AdamKorcz/go-118-fuzz-build is updated.
# see https://github.com/containerd/containerd/pull/13022#discussion_r2937038804
- testingcontext
staticcheck: staticcheck:
checks: checks:
- all - all