better support any using modern 1.25 ast and golang tools packages#39
Merged
Conversation
algorandskiy
approved these changes
Jul 10, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates msgp’s parsing logic to use Go 1.25-era type information (via go/packages + go/types) to classify any and other interface-derived type declarations semantically, instead of relying on string checks, while also updating the repo/tooling to Go 1.25 and newer x/tools.
Changes:
- Switch AST/package loading to include type info and classify type declarations as interfaces based on
go/typesunderlying types. - Expand parser tests and add dedicated testdata to ensure
any/ interface aliases and named interface types are handled correctly. - Bump Go/tooling versions and update CI to read the Go version from
go.mod.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
go.mod |
Bumps module Go version and updates golang.org/x/tools to support the newer go/packages usage. |
go.sum |
Refreshes sums for updated x/tools and transitive dependencies. |
tests/go.mod |
Bumps the nested test module’s Go version to match the updated toolchain baseline. |
parse/getast.go |
Uses packages type info (types.Info) to classify interface-like type declarations (including any and named/aliased interfaces). |
parse/getast_test.go |
Adds semantic/type-check-based tests for interface classification and a regression test using File() over testdata. |
parse/testdata/anydecl/anydecl.go |
Adds a concrete package fixture to exercise any/interface declarations through go/packages. |
.github/workflows/build.yml |
Updates CI to use go-version-file: go.mod rather than a hardcoded Go version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This updates #38 (already released in v1.1.64) to use Go 1.25's AST and package type parsing to detect any rather than checking if the identifier is
any. It should produce the same code as #38.