From f26765ceb0c882c50418f0f2bb58fa41506abc77 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 14 Apr 2025 19:33:42 +0200 Subject: [PATCH] update golangci-lint to v2.1.1 Fixes three new issues found by nilnesserr. Signed-off-by: Paul Holzinger --- Makefile | 2 +- pkg/api/handlers/compat/events.go | 2 +- pkg/api/handlers/libpod/pods.go | 2 +- pkg/bindings/manifests/manifests.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 30e7b2264d..a339a873a3 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,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.0.2 +GOLANGCI_LINT_VERSION := 2.1.1 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/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index fa398a4a13..f883c2c826 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -85,7 +85,7 @@ func GetEvents(w http.ResponseWriter, r *http.Request) { return } if evt.Error != nil { - logrus.Errorf("Unable to read event: %q", err) + logrus.Errorf("Unable to read event: %q", evt.Error) continue } if evt.Event == nil { diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go index 92b236d3bf..2610110931 100644 --- a/pkg/api/handlers/libpod/pods.go +++ b/pkg/api/handlers/libpod/pods.go @@ -167,7 +167,7 @@ func PodStop(w http.ResponseWriter, r *http.Request) { responses, stopError = pod.Stop(r.Context(), false) } if stopError != nil && !errors.Is(stopError, define.ErrPodPartialFail) { - utils.Error(w, http.StatusInternalServerError, err) + utils.Error(w, http.StatusInternalServerError, stopError) return } // Try to clean up the pod - but only warn on failure, it's nonfatal. diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go index 630a164df8..48720cb204 100644 --- a/pkg/bindings/manifests/manifests.go +++ b/pkg/bindings/manifests/manifests.go @@ -431,7 +431,7 @@ func Modify(ctx context.Context, name string, images []string, options *ModifyOp artifactWriterGroup.Wait() if artifactWriterError != nil { - return "", fmt.Errorf("uploading artifacts: %w", err) + return "", fmt.Errorf("uploading artifacts: %w", artifactWriterError) } data, err := io.ReadAll(response.Body)