cmd/compile: compiler cannot handle large / complex structs #44155
Comments
Thank you for the reproduction. |
We have a hardcoded limit of 65535 bytes for a type name. Unnamed struct types can get really long names. (As a workaround for now, it may help to pull out some of those structs into separate type declarations. That gives them names so they can be encoded in smaller strings.) |
It would probably be moderately safe to use a 65536 byte hash for symbol names that would otherwise be longer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote script to generate a struct that matched the input/output from an API (EdgeOS). The resulting struct is rather large, the code example below is only a portion. Running
go build
fails.What did you expect to see?
I expected
go build
to complete.What did you see instead?
truncated
Thanks to @davecheney who recommended I open a new issue, and not simply tag onto #18920.
Go Playground cannot handle the code for sharing either. Here is a complete example :
Example Code
The text was updated successfully, but these errors were encountered: