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
encoding/gob: zero value array within a struct is transmitted #13378
Comments
Yes, working as intended but not documented. |
May I ask what is the reason for this behavior? A consequence I found surprising is that, If struct X contains even one small array, the whole struct will never figure as zero (and omitted) when X itself is a field of another struct Y. |
CL https://golang.org/cl/17201 mentions this issue. |
Sorry guys, I could not comment on the CL in time. I believe that the documentation added does not address the issue. |
Reopening for further investigation and renaming. |
CL https://golang.org/cl/17394 mentions this issue. |
Documentation about struct encoding says: "If a field has the zero value for its type, it is omitted from the transmission."
It's actually not true for fields of array type:
https://play.golang.org/p/Zy8PIbmAGy
Is this working as intended?
I'm sorry to bother you here, but no one could answer me on go-nuts.
The text was updated successfully, but these errors were encountered: