Skip to content

gha: Update golangci-lint to v2.13.2 - #14089

Merged
mxpv merged 6 commits into
containerd:mainfrom
vvoland:update-golangci
Sep 3, 2026
Merged

mxpv merged 6 commits into
containerd:mainfrom
vvoland:update-golangci

Conversation

@vvoland

@vvoland vvoland commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

For Go1.27 support

@vvoland vvoland self-assigned this Sep 2, 2026
Copilot AI lite review requested due to automatic review settings September 2, 2026 16:51
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Sep 2, 2026
@vvoland
vvoland marked this pull request as draft September 2, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are consistent, mechanical, and scoped to tooling/lint upgrades plus straightforward modernizations without introducing behavioral risk in core logic.

Pull request overview

This PR updates the repository’s linting/tooling to a newer golangci-lint version (v2.13.2) to keep CI/dev tooling compatible with newer Go toolchains, and includes a set of small Go modernizations and lint-driven cleanups across the codebase.

Changes:

  • Bump golangci-lint to v2.13.2 in both CI and dev-tool installation.
  • Modernize several reverse-iteration loops to use slices.Backward and simplify error type assertions using errors.AsType.
  • Reduce linter noise and improve safety/correctness in a few spots (e.g., use DialContext, safer editor invocation, gosec suppressions with rationale, improved goroutine contexts).
File summaries
File Description
script/setup/install-dev-tools Updates locally-installed golangci-lint to v2.13.2.
.github/workflows/ci.yml Updates CI golangci-lint version to v2.13.2.
.golangci.yml Adjusts gosec excludes (adds G703, G122) for new lint behavior.
plugins/cri/cri.go Uses slices.Backward for clearer reverse scan of env PATH.
core/remotes/handlers.go Uses slices.Backward for reverse dispatch ordering.
core/remotes/docker/fetcher.go Uses slices.Backward for reverse encoding handling; minor cleanup.
core/remotes/docker/authorizer.go Simplifies error matching via errors.AsType.
core/mount/mount.go Uses slices.Backward for reverse unmount ordering.
core/mount/manager/manager.go Uses slices.Backward during deactivation unmount sequence.
core/diff/stream.go Uses slices.Backward to prioritize later-registered handlers.
pkg/shim/util_unix.go Replaces errors.As boilerplate with errors.AsType.
internal/cri/util/sanitize.go Uses errors.AsType for *url.Error extraction.
internal/cri/server/sandbox_run.go Uses errors.AsType for cleanup error detection.
internal/cri/server/container_create.go Uses errors.AsType for reserved-name concurrency warning path.
internal/cri/server/podsandbox/sandbox_run.go Improves exit-wait goroutine context propagation using WithoutCancel + namespace.
internal/cri/server/podsandbox/recover.go Same exit-wait context improvement during recovery.
cmd/containerd/server/server.go Uses slices.Backward for reverse plugin stop ordering.
cmd/containerd/server/config/config.go Uses errors.AsType for TOML decode error handling.
cmd/containerd-shim-runc-v2/task/service.go Uses context.WithoutCancel(ctx) for publisher forwarding context.
cmd/ctr/commands/shim/pprof.go Uses DialContext and net.Dialer.DialContext for better cancellation behavior.
cmd/ctr/commands/pprof/pprof.go Switches transport to DialContext for pprof client.
cmd/ctr/commands/pprof/pprof_unix.go Updates dialer signature to DialContext-compatible and uses net.Dialer.
cmd/ctr/commands/pprof/pprof_windows.go Updates dialer signature to DialContext-compatible and uses DialPipeContext.
cmd/ctr/commands/content/content.go Safer editor invocation by passing filename via "$@" rather than string interpolation.
contrib/apparmor/template.go Adds justified gosec suppression for fixed-executable command invocation.
integration/failpoint/cmd/runc-fp/main.go Adds justified gosec suppression for fixed-executable proxy invocation.
Review details
  • Files reviewed: 26/26 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

For Go1.27 support

Staticcheck analyzes only the files selected for the current OS. On
macOS, unsupported-platform stubs always return errors, so SA4023
mistakes valid shared error checks for constant comparisons. The Linux
and Windows implementations can still return nil.

Exclude SA4023 only at the affected cross-platform call sites, keeping
the check active elsewhere. Also use a single-line pipe wrapper return
because Go 1.26 and Go 1.27 gofmt disagree on the multiline indentation.

Signed-off-by: Paweł Gronowski <[email protected]>
Copilot AI review requested due to automatic review settings September 2, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The updates are consistent with the stated Go 1.27 support goal and the changes are mechanical/low-risk with no correctness issues found in the modified code paths.

Review details
  • Files reviewed: 26/26 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@vvoland
vvoland marked this pull request as ready for review September 3, 2026 08:48

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah

Copy link
Copy Markdown
Member

cc @samuelkarp @dmcgowan

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Sep 3, 2026
@mxpv
mxpv added this pull request to the merge queue Sep 3, 2026
Merged via the queue into containerd:main with commit cc53b7e Sep 3, 2026
96 of 98 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants