I am having a json as
{
\"fields\": [\"time\",\"id\",\"status\",\"customerId\",\"additionalDetail\"],
\"pageInfo\": {\"start\": 0, \"rows\": 1000}
}
This works, but it is ugly:
bd := RBody { Fields : []string{"time","id","status","customerId","additionalDetail"},
PageInfo : struct {Start int `json:"start"`
Rows int `json:"rows"`} {Start:1,Rows:2}}
I suggest you either name the anonymous struct, or initialize Fields in the declaration, and PageInfo using assignments later.