Skip to content

chore(deps): update golangci-lint to v2.13.0 for Go 1.27 support - #705

Closed
wallrj-cyberark wants to merge 1 commit into
cert-manager:mainfrom
wallrj-cyberark:golangci-lint-v2.13.0
Closed

chore(deps): update golangci-lint to v2.13.0 for Go 1.27 support#705
wallrj-cyberark wants to merge 1 commit into
cert-manager:mainfrom
wallrj-cyberark:golangci-lint-v2.13.0

Conversation

@wallrj-cyberark

Copy link
Copy Markdown
Member

Motivation

37ea719 (#704) bumped VENDORED_GO_VERSION to 1.27.0. Lint then fails in every repository that vendors the tools module, because golangci-lint v2.12.2 cannot analyse the Go 1.27 standard library:

  • When the binary is built with Go 1.26 (which is what happens whenever a cached golangci-lint@v2.12.2 binary is reused, since the download path is not keyed on the Go version), it fails to type-check the generic methods introduced in the Go 1.27 standard library:

    _bin/tools/goroot/src/crypto/internal/randutil/randutil.go:11:2: could not import math/rand/v2 (_bin/tools/goroot/src/math/rand/v2/rand.go:213:17: method must have no type parameters) (typecheck)
    
  • Rebuilding v2.12.2 with Go 1.27 gets past that, but staticcheck (honnef.co/go/tools v0.7.0) then panics while building its IR for the Go 1.27 standard library:

    goanalysis_metalinter: buildir: package "poll" (isInitialPkg: false, needAnalyzeSource: true): unexpected expr: *ast.KeyValueExpr
    

golangci-lint v2.13.0 ships honnef.co/go/tools v0.8.0-rc.1 and analyses the Go 1.27 standard library without error.

Renovate has this upgrade queued in the Tools group on the dependency dashboard (#487), held behind the stability gate, so this change simply brings it forward — lint is broken in the meantime.

Testing

Verified in a downstream repository that vendors the tools and klone modules, with VENDORED_GO_VERSION := 1.27.0:

  • golangci-lint v2.12.2 built with Go 1.26.5: typecheck failure shown above.
  • golangci-lint v2.12.2 rebuilt with Go 1.27.0: staticcheck panic shown above.
  • golangci-lint v2.13.0 built with Go 1.27.0: 0 issues.

golangci-lint v2.12.2 cannot analyse the Go 1.27 standard library, which
broke lint in downstream repositories as soon as VENDORED_GO_VERSION was
bumped to 1.27.0.

- Built with Go 1.26, it fails to type-check the generic methods
  introduced in the Go 1.27 standard library.
- Rebuilt with Go 1.27, staticcheck (honnef.co/go/tools v0.7.0) panics
  with 'unexpected expr: *ast.KeyValueExpr'.

v2.13.0 ships honnef.co/go/tools v0.8.0-rc.1 and analyses the Go 1.27
standard library without error.

Signed-off-by: Richard Wall <richard.wall@cyberark.com>
@cert-manager-prow cert-manager-prow Bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Aug 20, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign munnerz for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 20, 2026
@wallrj-cyberark

Copy link
Copy Markdown
Member Author

Closing in favour of Renovate: the Tools group upgrade has been forced through from the dependency dashboard (#487), so the same golangci-lint v2.13.0 bump will arrive as a Renovate PR shortly.

For the record, the detail above still applies — golangci-lint v2.12.2 cannot analyse the Go 1.27 standard library, so lint is broken in downstream repositories until that upgrade lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant