From 5e3719c81a3372ebcf434803079a4d0a0f2f6c90 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 23 Feb 2026 09:53:35 +0100 Subject: [PATCH 1/4] fix two issues found by nilness Signed-off-by: Paul Holzinger --- cmd/podman-testing/call.go | 3 --- pkg/domain/infra/tunnel/images.go | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/podman-testing/call.go b/cmd/podman-testing/call.go index c9d65bdf11..b4c9ac38a8 100644 --- a/cmd/podman-testing/call.go +++ b/cmd/podman-testing/call.go @@ -55,9 +55,6 @@ func ls(_ *cobra.Command, args []string) error { if err != nil { return fmt.Errorf("setting up grpc client for podman service: %w", err) } - if err != nil { - return fmt.Errorf("setting up grpc client for podman service: %w", err) - } reflectionClient := reflectionv1.NewServerReflectionClient(grpcClient) if reflectionClient == nil { return fmt.Errorf("setting up client for reflection grpc service: %w", err) diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index c8430345b8..813bf7c4b4 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -418,9 +418,7 @@ func (ir *ImageEngine) Build(_ context.Context, containerFiles []string, opts en if err == nil { return report, nil } - if err != nil { - logrus.Debugf("BuildLocal failed: %v", err) - } + logrus.Debugf("BuildLocal failed: %v", err) var errModel *errorhandling.ErrorModel if errors.As(err, &errModel) { From 8a0c7770172e8302c1a4421ddedbc99b2ce8c0cd Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 23 Feb 2026 10:00:51 +0100 Subject: [PATCH 2/4] fix new staticcheck warnings As reported by golangci-lint v2.10.1. Signed-off-by: Paul Holzinger --- libpod/info.go | 6 +++--- pkg/systemd/quadlet/quadlet.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libpod/info.go b/libpod/info.go index f8dfdbecf7..eb448a927b 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -163,13 +163,13 @@ func (r *Runtime) hostInfo() (*define.HostInfo, error) { // Could not find a humanize-formatter for time.Duration var buffer bytes.Buffer - buffer.WriteString(fmt.Sprintf("%.0fh %.0fm %.2fs", + fmt.Fprintf(&buffer, "%.0fh %.0fm %.2fs", uptime.hours, math.Mod(uptime.minutes, 60), math.Mod(uptime.seconds, 60), - )) + ) if int64(uptime.hours) > 0 { - buffer.WriteString(fmt.Sprintf(" (Approximately %.2f days)", uptime.hours/24)) + fmt.Fprintf(&buffer, " (Approximately %.2f days)", uptime.hours/24) } info.Uptime = buffer.String() diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index 0f13bf98fa..2f791eec33 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -1144,7 +1144,7 @@ func ConvertVolume(volume *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, i if opts.Len() > 2 { opts.WriteString(",") } - opts.WriteString(fmt.Sprintf("uid=%d", uid)) + fmt.Fprintf(&opts, "uid=%d", uid) } if volume.HasKey(VolumeGroup, "Group") { @@ -1152,7 +1152,7 @@ func ConvertVolume(volume *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, i if opts.Len() > 2 { opts.WriteString(",") } - opts.WriteString(fmt.Sprintf("gid=%d", gid)) + fmt.Fprintf(&opts, "gid=%d", gid) } copy, ok := volume.LookupBoolean(VolumeGroup, KeyCopy) From 02f0766a790928b0a448bb80947cd5fc4d71afbf Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 23 Feb 2026 10:13:48 +0100 Subject: [PATCH 3/4] update golangci-lint to v2.10.1 And remove one false positive comment that got fixed as it seems like. Signed-off-by: Paul Holzinger --- Makefile | 2 +- libpod/oci_conmon_linux.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a6112c01c4..def0bc5aef 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.9.0 +GOLANGCI_LINT_VERSION := 2.10.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/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index 8ef84f0cbc..bb80700d69 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -80,7 +80,6 @@ func (r *ConmonOCIRuntime) createRootlessContainer(ctr *Container, restoreOption var parentMount string for dir := filepath.Dir(rootPath); ; dir = filepath.Dir(dir) { if m, found := byMountpoint[dir]; found { - //nolint:staticcheck // false positive?! it claims the value of parentMount is not used but we use it below for the mount parentMount = dir for o := range strings.SplitSeq(m.Optional, ",") { opt := strings.Split(o, ":") From 9a1e5e8eeba9731c48a8efe7981314dd8a2f46cd Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 25 Feb 2026 11:06:25 +0100 Subject: [PATCH 4/4] cmd/podman-tetsing: fix incorrect error message Signed-off-by: Paul Holzinger --- cmd/podman-testing/call.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/podman-testing/call.go b/cmd/podman-testing/call.go index b4c9ac38a8..00eb695f93 100644 --- a/cmd/podman-testing/call.go +++ b/cmd/podman-testing/call.go @@ -57,7 +57,7 @@ func ls(_ *cobra.Command, args []string) error { } reflectionClient := reflectionv1.NewServerReflectionClient(grpcClient) if reflectionClient == nil { - return fmt.Errorf("setting up client for reflection grpc service: %w", err) + return errors.New("setting up client for reflection grpc service") } info, err := reflectionClient.ServerReflectionInfo(ctx) if err != nil {