I want a relationship between structs, example:
type A struct {
X string
Y int
*A
}
It's possible this? And if it's possible, what is the right way to marshal and unmarshal to JSON this?
When i marshal this struct to JSON the field A is lost.
The code is correct, but the anonimous filed A is lost because have the same names as the struct. Solution:
type A struct {
X string
Y int
Z *A
}