I have a struct as follows:
type Node struct {
Name string
Children []*Node
Values []string
}
I also have a set of json files describing my trees such as:
{
"something": {
"someblah": [
"fluf",
"glah"
],
"someother": {
"someotter": [
"blib",
"fnar"
]
}
}
}
How can I deserialize these files into the structs?
All the examples I found seem to require a different structure with named key/value pairs.
For this, the structure is key:
- the key is the struct name
- the map contents are children
- the lists contents are values
I cannot understand how to map this logic into the golang json serializer.