Greetings to all how much JSON wrote into the GO structure did not come across such, you can tell how to write a JSON field in the structure if it changes dynamically, for example,
JSON contains an array of objects, but the name of the object can be any, so I can not specify it as json:"dynfield", because it will always be different
JSON
"title1": [
{
"dynfield1" : {
"field1" : "value1",
"field2" : "value2",
...
},
"dynfield2" : {
"field1" : "value1",
"field2" : "value2",
...
},
}
]
“dynfield” can be any value
type gomarsh struct {
title1 []title1 `json:"title1"
}
type title1 struct {
dynfield dynfield `json:"dynfieldn"` // As can be represented
}