Marshaling flattens embedded struct fields just fine but fails with struct fields
abstracted by interface types. In essence:
struct{ someStruct }{someStruct{}} // properly flattened
type Any interface{}
struct{ Any }{someStruct{}} // not flattened: "Any":{ ... }
See http://play.golang.org/p/-ZtaIGe7QJ for an example.
I think if the underlying type of the embedded interface is a struct the output should
be flattened.
go version devel +9c65fe4ce5a2 Wed Jan 29 09:51:31 2014 +0900 linux/amd64
The text was updated successfully, but these errors were encountered:
Embedded interfaces and embedded structs are just different. Here is a version of your
program demonstrating the difference. If we "flatten", then how do we know how to
unmarshal? http://play.golang.org/p/orp7cvQplU
by pronox:
The text was updated successfully, but these errors were encountered: