I am trying to parse json to go lang struck but some how the object is return empty:
Json Object:
`{
"names": [
{
"David": {
"id": "100",
"country": "usa",
"group": [
"A1",
"A2"
]
}
},
{
"John": {
"id": "1",
"country": "uk",
"group": [
"A1",
"A2"
]
}
}
]
}`
GoLang struct:
type Data struct {
Names []Names `json:"names"`
}
type Names struct {
ID string `json:"id"`
Country string `json:"country"`
Group []string `json:"group"`
}
The issue that array contains 2 element David,John somehow it return empty object as the parser has problem to extract the strings David,John