ci: bump golangci-lint to v2.9.0

Apparently, prealloc got much smarter in this version, so let's disable it for _test.go files as we're not really interested in micro-optimizations for the test code.

The rest of its warnings is being fixed by the earlier commits.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

(cherry picked from commit 0ba42fe487)
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
Kir Kolyshkin 2026-09-11 15:52:42 -04:00 • committed by Lokesh Mandvekar
parent 8e0f540d1d
commit 4b35507708
No known key found for this signature in database
GPG key ID: 1C1EDD7CC7C3A0DD
3 changed files with 4 additions and 2 deletions

View file

@ -85,6 +85,9 @@ linters:
- linters:
- recvcheck
path: pkg/k8s.io/
- path: _test\.go
linters:
- prealloc
issues:
max-issues-per-linter: 0

View file

@ -71,7 +71,7 @@ BUILDTAGS += ${EXTRA_BUILDTAGS}
# N/B: This value is managed by Renovate, manual changes are
# possible, as long as they don't disturb the formatting
# (i.e. DO NOT ADD A 'v' prefix!)
GOLANGCI_LINT_VERSION := 2.5.0
GOLANGCI_LINT_VERSION := 2.9.0
PYTHON ?= $(shell command -v python3 python|head -n1)
PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)
# ~/.local/bin is not in PATH on all systems

View file

@ -133,7 +133,6 @@ func (m *InMemoryManager) AvailableLocks() (*uint32, error) {
// Get any locks that are presently being held.
// Useful for debugging deadlocks.
func (m *InMemoryManager) LocksHeld() ([]uint32, error) {
//nolint:prealloc
var locks []uint32
for _, lock := range m.locks {