Open rsgok opened 2 years ago
func main() { a := A{ Tag: "tag-A", Num: 1, InA: InA{ Id: 100, Type: "test", }, } spew.Dump(a) } type A struct { Tag string Num int InA } type InA struct { Id int Type string } func (t InA) String() string { return t.Type }
(main.A) test
and if struct member not anonymous, go-spew works
example code
unexpected output