Skip to content

better support any using modern 1.25 ast and golang tools packages#39

Merged
cce merged 3 commits into
masterfrom
better-support-any
Jul 10, 2026
Merged

better support any using modern 1.25 ast and golang tools packages#39
cce merged 3 commits into
masterfrom
better-support-any

Conversation

@cce

@cce cce commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/types underlying 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.

Comment thread go.mod
Comment thread tests/go.mod
Comment thread parse/getast.go
@cce cce force-pushed the better-support-any branch from 68f2ac2 to 3ea8eee Compare July 10, 2026 17:59
@cce cce merged commit bd46b15 into master Jul 10, 2026
4 checks passed
@cce cce deleted the better-support-any branch July 10, 2026 18:06
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.

3 participants