Skip to content

Conversation

reillywatson
Copy link
Contributor

Go 1.23 changed how go/types handles type aliases, which breaks code generation if you use a package that has an alias type (example: https://pkg.go.dev/github.com/golang/[email protected]/ptypes/timestamp#Timestamp). These were getting generated as just the unqualified name, without the package. If you used a previous version of Go, it meant that if that aliased type was in an internal package we'd try to import the internal package instead, resulting in a compilation error.

Add a switch to handle that case, and bump the go.mod version to support using types.Alias.

Go 1.23 changed how go/types handles type aliases, which breaks code generation if you use a package that has an alias type (example: https://pkg.go.dev/github.com/golang/[email protected]/ptypes/timestamp#Timestamp). These were getting generated as just the unqualified name, without the package. If you used a previous version of Go, it meant that if that aliased type was in an internal package we'd try to import the internal package instead, resulting in a compilation error.

Add a switch to handle that case, and bump the go.mod version to support using types.Alias.
@sudo-suhas sudo-suhas merged commit 5dfcd56 into matryer:main Aug 24, 2024
4 checks passed
@sudo-suhas
Copy link
Collaborator

Thanks @reillywatson for the PR! Changes have been released in [email protected]

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