encoding/json: UnmarshalJSON not working consistently with struct embedding #39175
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
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?
Case 1
Run following code:
Case 2
Run above code, but comment out line 13 (i.e. remove the
Baz
embedded field fromFoo
).What did you expect to see?
Case 1
Case 2
What did you see instead?
Case 1
As expected.
Case 2
Summary
The behavior of nested field seems not consistent between only one nested filed and having multiple nested fields.
The text was updated successfully, but these errors were encountered: