Skip to content

[DNM] Bump golangci-lint to v2.13.2 for Go 1.26 export-data support - #67

Open
Randy424 wants to merge 1 commit into
Ginxo:mainfrom
Randy424:acm-42591-golangci-fix
Open

Randy424 wants to merge 1 commit into
Ginxo:mainfrom
Randy424:acm-42591-golangci-fix

Conversation

@Randy424

Copy link
Copy Markdown

Purpose

While validating ACM-42591's CI/CD pipeline changes against a real Prow run, ci/prow/check failed with:

could not decode "sync/atomic", export data version 4 is greater than maximum supported version 2

Traced this to golangci-lint v1.64.8 predating Go 1.26 by nearly a year. Confirmed via golangci-lint's own changelog that Go 1.26 support (golangci-lint#6271) first shipped in v2.9.0. This is not an environment problem, the runner image already has Go, it's purely the linter binary being too old to read Go 1.26's export data format.

What this does

  • Bumps GOLANGCI_LINT_VERSION to v2.13.2 in scripts/golangci-lint-backend.sh (note the /v2/ in the install path, v2 is a separate Go module)
  • Migrates backend/.golangci.yml to the v2 config schema via golangci-lint's own migrate command (v1/v2 use incompatible schemas)
  • Fixes the 3 real staticcheck findings the version bump surfaces (previously masked entirely by the export-data crash, these aren't new bugs):
    • aggregate/status.go: simplify a negated boolean expression
    • auth/auth.go: drop a redundant .TLSClientConfig. selector (it's embedded in rest.Config)
    • vmproxy/units.go: error strings should not be capitalized or end in punctuation (6 occurrences)

Verified

One thing worth a look, not fixed here

The version bump also surfaces 3 new unused findings, in internal/clusterinfo/clusterinfo_test.go and internal/informers/factory_test.go (test helpers that look declared but never referenced), from the recent partial-discovery work in #66. Left those alone since they're outside this fix's scope, might be worth a second look from whoever wrote that test.

🤖 Generated with Claude Code

golangci-lint v1.64.8 predates Go 1.26 by nearly a year and cannot
read its export data format, failing with:

  could not decode ..., export data version 4 is greater than
  maximum supported version 2

Confirmed via golangci-lint's own changelog that go1.26 support
(golangci-lint#6271) first shipped in v2.9.0. Verified independently
against a real Prow CI run (stolostron/console, ACM-42591 validation
PR): switching to v2.13.2 clears the export-data error completely.

v1 and v2 use incompatible config schemas, so backend/.golangci.yml
is migrated via golangci-lint's own migrate command rather than
hand-edited. The migration tool correctly drops errcheck, gosimple,
govet, ineffassign, staticcheck, and unused from the explicit enable
list (now part of v2's default set) and moves gci under the new
formatters section.

Also fixes the 3 real staticcheck findings the version bump surfaces
(previously masked by the export-data crash, not new bugs):
- aggregate/status.go: simplify a negated boolean (De Morgan's law)
- auth/auth.go: TLSClientConfig is embedded in rest.Config; the
  explicit selector was redundant
- vmproxy/units.go: error strings should not be capitalized or end
  in punctuation (six occurrences, ST1005)

Note: the version bump also surfaces 3 new unused findings in
internal/clusterinfo/clusterinfo_test.go and
internal/informers/factory_test.go (test helpers that appear to be
declared but never referenced), from the recent partial-discovery
work in stolostron#66. Left those alone since they are outside this fix's
scope and worth a second look from whoever wrote that test.

Signed-off-by: Randy Bruno Piverger <21374229+Randy424@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Randy424 Randy424 changed the title Bump golangci-lint to v2.13.2 for Go 1.26 export-data support [DNM] Bump golangci-lint to v2.13.2 for Go 1.26 export-data support Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant