Skip to content

Update golangci-lint version to v2.15 - #179

Merged
dcrossleyau merged 1 commit into
folio-org:masterfrom
MikeTaylor:patch-1
Oct 28, 2026
Merged

dcrossleyau merged 1 commit into
folio-org:masterfrom
MikeTaylor:patch-1

Conversation

@MikeTaylor

Copy link
Copy Markdown
Contributor

mop-reporting's make lint runs fine locally but fails in CI:

Error: main.go:3:8: could not import os (/opt/hostedtoolcache/go/1.27.3/x64/src/os/dir.go:8:2: could not import internal/bytealg (/opt/hostedtoolcache/go/1.27.3/x64/src/internal/bytealg/bytealg.go:8:2: could not import internal/cpu (-: could not load export data: internal error in importing "internal/cpu" (cannot decode "internal/cpu", export data version 5 is greater than maximum supported version 4); please report an issue))) (typecheck)

mod-reporting's CI lint job (go-lint.yml) calls the shared lint workflow in folio-org/.github. That workflow's golangci-lint step, .github/workflows/go-lint-golangci.yml@v1, does two relevant things:

  • actions/setup-go with go-version: 'stable', which now installs Go 1.27.3 (the version in your error).
  • golangci/golangci-lint-action@v9 with version: v2.13, which resolves to v2.13.2.

The 1.27.3 standard library is compiled in a newer internal format, version 5. golangci-lint reads that format through Go's golang.org/x/tools package, which added support for version 5 on 2026-09-02. So we need a newer version of golangci-lint which understands that format.

mop-reporting's `make lint` runs fine locally but fails in CI:

> Error: main.go:3:8: could not import os (/opt/hostedtoolcache/go/1.27.3/x64/src/os/dir.go:8:2: could not import internal/bytealg (/opt/hostedtoolcache/go/1.27.3/x64/src/internal/bytealg/bytealg.go:8:2: could not import internal/cpu (-: could not load export data: internal error in importing "internal/cpu" (cannot decode "internal/cpu", export data version 5 is greater than maximum supported version 4); please report an issue))) (typecheck)

mod-reporting's CI lint job (go-lint.yml) calls the shared lint workflow in folio-org/.github. That workflow's golangci-lint step, .github/workflows/go-lint-golangci.yml@v1, does two relevant things:
* actions/setup-go with go-version: 'stable', which now installs Go 1.27.3 (the version in your error).
* golangci/golangci-lint-action@v9 with version: v2.13, which resolves to v2.13.2.

The 1.27.3 standard library is compiled in a newer internal format, version 5. golangci-lint reads that format through Go's golang.org/x/tools package, which added support for version 5 on 2026-09-02. So we need a newer version of golangci-lint which understands that format.
@MikeTaylor

Copy link
Copy Markdown
Contributor Author

@dcrossleyau I don't seem to be able to tag you as a reviewer for this. Can you please take a look, and merge if it looks good? Until that's done I can't merge anything in mod-reporting.

@dcrossleyau
dcrossleyau self-requested a review October 28, 2026 02:44
@dcrossleyau
dcrossleyau merged commit 1743ffb into folio-org:master Oct 28, 2026
2 checks passed
@dcrossleyau

Copy link
Copy Markdown
Contributor

This is now done. Also an upgrade to staticcheck to use Go 1.27 etc.
See release v1.17.6

@MikeTaylor

Copy link
Copy Markdown
Contributor Author

Excellent, many thanks!

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.

2 participants