From 0ba42fe487b66e42e2d0603bdf94f2af781a8a1e Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 5 Feb 2026 16:45:53 -0800 Subject: [PATCH] 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 --- .golangci.yml | 3 +++ Makefile | 2 +- libpod/lock/in_memory_locks.go | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ed1ce1e44b..c474316ae9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -73,6 +73,9 @@ linters: - linters: - recvcheck path: pkg/k8s.io/ + - path: _test\.go + linters: + - prealloc issues: max-issues-per-linter: 0 diff --git a/Makefile b/Makefile index 0c96f76efe..a6112c01c4 100644 --- a/Makefile +++ b/Makefile @@ -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.6.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 diff --git a/libpod/lock/in_memory_locks.go b/libpod/lock/in_memory_locks.go index 9787d450b7..09a05853b9 100644 --- a/libpod/lock/in_memory_locks.go +++ b/libpod/lock/in_memory_locks.go @@ -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 {