encoding/json: unmarshal does not correctly zero out slices #24155
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
What version of Go are you using (
go version
)?1.10
Does this issue reproduce with the latest release?
1.10 is the latest release at the time of this submission
What operating system and processor architecture are you using (
go env
)?darwin/amd64
What did you do?
play.golang example showing address reuse
MyStruct
play.golang example demoing bad behavior
MyStruct
MyStruct
Name
field was deserialized correctly and was not overriddenWhat did you expect to see?
data1
anddata2
were deserialized into structs, and appended to a slice without overriding each other.What did you see instead?
data2
's alphabet values overwrote elements indata1
's alphabet. This is in contrast to howname
behaves.The text was updated successfully, but these errors were encountered: