You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http://play.golang.org/p/ZG7QaannqG
Above is the working sample. When using anonymous properties, marshal is ignoring them.
In given sample i expect output to be same for both structs.
The text was updated successfully, but these errors were encountered:
Working as intended? See http://golang.org/pkg/encoding/json/#Marshal
"Anonymous struct fields are usually marshaled as if their inner exported fields were
fields in the outer struct, subject to the usual Go visibility rules amended as
described in the next paragraph. An anonymous struct field with a name given in its JSON
tag is treated as having that name, rather than being anonymous."
by manishtpatel:
The text was updated successfully, but these errors were encountered: