Support Go 1.27 by upgrading golang.org/x/tools to v0.48.0 - #312
Merged
Conversation
Go 1.27's compiler emits export data version 4, which x/tools v0.36.0 cannot decode. mockgen's package mode imports type information through x/tools, so generating mocks on Go 1.27 failed with "export data version 4 is greater than maximum supported version 2". x/tools v0.44.0 is the first release that decodes the new format and it requires Go 1.25, so the module's minimum Go version moves from 1.23 to 1.25 — there is no upgrade path that keeps 1.24 support. The generics and typed test sub-modules are re-tidied to match, the CI test matrix drops 1.24.x in favor of 1.25.x/1.26.x plus 1.27.0-rc.2 to guard against future export-data bumps, and the release workflow moves off the no-longer-buildable 1.23.x.
rabbbit
approved these changes
Aug 9, 2026
sywhang
approved these changes
Aug 9, 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.
Why
Go 1.27's compiler emits export data version 4, which the pinned
golang.org/x/toolsv0.36.0 cannot decode. mockgen's package mode imports type information through x/tools, so generating mocks on Go 1.27 (currently rc2) fails with:What
golang.org/x/toolsv0.36.0 → v0.48.0 (withx/modv0.38.0,x/syncv0.22.0).genericsandtypedtest sub-modules, whichreplacethe main module.[1.24.x, 1.25.x]→[1.25.x, 1.26.x, 1.27.0-rc.2](1.24.x can no longer build the module; the rc entry guards against future export-data bumps); release workflow 1.23.x → 1.25.x.The bazel module is unaffected — it pins the published
go.uber.org/mock v0.6.0with its own SDK, so it picks up Go 1.27 support with the next release.Test Plan
Full test suite passes on both go1.27rc2 and go1.26.4 (all packages, including the
tools,generics, andtypedsub-modules),go vet ./...is clean, and bothci/test.shandci/check_panic_handling.shpass locally with go1.27rc2.