Repository navigation
ci: build and test against latest and latest-1 Go releases - #340
Merged
Merged
Conversation
dmcgowan
force-pushed
the
update-go-version
branch
from
October 29, 2026 22:17
1fac841 to
f616e39
Compare
samuelkarp
reviewed
Oct 29, 2026
CI was pinned to Go 1.22.x, which has been end-of-life for some time, and
every new Go release required a manual bump in two workflows.
Use actions/setup-go's 'stable' and 'oldstable' selectors instead, so the
test matrix always covers the latest Go release and the one before it with
no ongoing maintenance. This follows the pattern already used by
containerd/ttrpc and containerd/plugin. Jobs that only need a single Go
version (project checks, linters, cross-compile, CodeQL) use 'stable'.
Also set GOTOOLCHAIN=local so that a go.mod requiring a newer toolchain
than the installed one fails loudly instead of silently downloading it.
Tracking the latest Go release requires a linter that supports it, so move
off golangci-lint v1.62.0, which is EOL and caps out well below the current
Go release. Pin v2.12.2 and migrate .golangci.yml to the v2 schema:
- gofmt and goimports are formatters in v2, not linters
- govet, ineffassign, staticcheck and unused come from the default
'standard' set, so they no longer need to be listed
- issues.exclude-rules moved to linters.exclusions.rules
- the exclusion presets restore the default exclusions that v1 applied
implicitly, keeping the effective linter behaviour unchanged
v2's staticcheck subsumes gosimple and stylecheck, which surfaces two new
findings; fix both. Drop 'deadcode' from //nolint directives as that linter
no longer exists.
Lint now runs in its own job rather than once per test matrix entry. This
uses a prebuilt golangci-lint instead of compiling it from source in every
job, which offsets the cost of doubling the test matrix.
Signed-off-by: Derek McGowan <derek@mcg.dev>
dmcgowan
force-pushed
the
update-go-version
branch
2 times, most recently
from
October 29, 2026 22:33
edebe28 to
efbb0b9
Compare
samuelkarp
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI was pinned to Go 1.22.x, which has been end-of-life for some time, and every new Go release required a manual bump in two workflows.
Use actions/setup-go's 'stable' and 'oldstable' selectors instead, so the test matrix always covers the latest Go release and the one before it with no ongoing maintenance. This follows the pattern already used by containerd/ttrpc and containerd/plugin. Jobs that only need a single Go version (project checks, linters, cross-compile, CodeQL) use 'stable'.
Also set GOTOOLCHAIN=local so that a go.mod requiring a newer toolchain than the installed one fails loudly instead of silently downloading it.
Tracking the latest Go release requires a linter that supports it, so move off golangci-lint v1.62.0, which is EOL and caps out well below the current Go release. Pin v2.12.2 and migrate .golangci.yml to the v2 schema:
v2's staticcheck subsumes gosimple and stylecheck, which surfaces two new findings; fix both. Drop 'deadcode' from //nolint directives as that linter no longer exists.
Lint now runs in its own job rather than once per test matrix entry. This uses a prebuilt golangci-lint instead of compiling it from source in every job, which offsets the cost of doubling the test matrix.