You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: upgrade golangci-lint for Go 1.26 and fix all findings
The Go 1.26 toolchain bump requires a newer golangci-lint (the pinned v2.1.6,
built with Go 1.24, refuses a 1.26 target). Bump to v2.12.2 in lint.yml and the
Makefile, set lint.yml's Go to 1.26, and resolve every finding the newer linter
surfaces so full `golangci-lint run ./...` passes.
Fixes:
- staticcheck (deprecations): migrate webhook validators/defaulters from the
deprecated CustomValidator/CustomDefaulter to the typed admission.Validator[T]
/ Defaulter[T] API; migrate api/* and internal/config scheme.Builder to
runtime.NewSchemeBuilder; SchemeGroupVersion -> GroupVersion; drop the
deprecated rateLimit.Type check (the Global guard already forbids global rate
limiting); client.Apply left with a justified nolint (the typed Client.Apply
needs a generated ApplyConfiguration — tracked for follow-up).
- goconst: extract package-level consts for repeated literals in production code.
- prealloc / unconvert: preallocate flagged slices; drop a redundant conversion.
Lint-policy tuning (idiomatic-pattern noise, not code smells):
- exclude goconst in *_test.go (fixture/table data hurts readability as consts)
- exclude prealloc in internal/validation (field.ErrorList accumulators)
Verified: golangci-lint run ./... = 0 issues; go build/vet/test ./... all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments