-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded / inline type aliases trigger panic #1088
Comments
I was trying to understand what was happening and managed to work around the error #1089. However, this is not the correct approach... |
This was referenced Nov 9, 2024
Merged
cc @mtardy (Just fyi) |
Thanks for the note, I'll take a look next week :) |
@mtardy bump (absolutely 0 pressure, just in case you have time and want to look into it :)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A panic occurs when an embedded/inline field is a type alias and Alias types are enabled in Go.
To reproduce on the
main
branch:The output will be following
When running
GODEBUG=gotypesalias=0 go generate
or justgo generate
there will not be panic. I assume this is because of Go language level ingo.mod
.FYI: Interestingly, I found the issue while running
controller-gen
in another project usinggo run sigs.k8s.io/controller-tools/cmd/controller-gen ...
with go1.23.x. However, usinggo run sigs.k8s.io/controller-tools/cmd/[email protected] ...
avoids the panic. We have pinnedcontroller-tools
v0.16.5 in the project'sgo.mod
but it makes difference if thego run
command has the version or not. When runninggo run -x
, I noticed thatgotypesalias=0
is set when specifying@v0.16.5
, whereas without it, no flag is set, and compiler enables Alias types by default, presumably because project's language level ingo.mod
got set to Go 1.23 as a side effect after bumping some dependencies.The text was updated successfully, but these errors were encountered: