encoding/json: unexported embedded fields are not properly ignored #21121
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
Regression from Go1.8
https://golang.org/cl/33773 fixes the JSON marshaller to avoid serializing
embedded fields on unexported fields of non-struct type.
In order to determine whether a field is exported or not, it relies on
StructField.PkgPath to be non-empty if exported, but this is not always true
(see #21122).
Example reproduction:
This prints:
But should really print:
\cc @ianlancetaylor
The text was updated successfully, but these errors were encountered: