I have a solr response in JSON format which looks like this:
{
"responseHeader": {
"status": 0,
"QTime": 0,
"params": {
"q": "solo",
"wt": "json"
}
},
"response": {
"numFound": 2,
"start": 0,
"docs": [
{
<Large nested JSON element>
},
{
<Large nested JSON element>
}
]
}
}
Now, in my Golang app, I would like to quickly remove the "responseHeader" so that I can return the "response" alone. How can I do this without creating large structures?
Edit 1
The answer by evanmcdonnal was the solution to this problem, but it had some minor typos, this is what I ended up using:
var temp map[string]interface{}
if err := json.Unmarshal(body, &temp); err != nil {
panic(err.Error())
}
result, err := json.Marshal(temp["response"])