If I have JSON that looks like this: > > { > > "value" : { > > "IPAddr=10.1.1.12" : { > > "ReplyTime" : { > > "minTime" : 0, > > "maxTime" : 0, > > "averageTime" : 0 > > } > > } > > } > > } > > Normally you'd setup a struct:
> type IpAddress struct { > > Value struct { > > IPAddr_10_1_1_12 struct { > > ReplyTime struct { > > AverageTime int `json:"averageTime"` > > MaxTime int `json:"maxTime"` > > MinTime int `json:"minTime"` > > } `json:"ReplyTime"` > > } `json:"IPAddr=10.1.1.12"` > > } `json:"value"` > > } > > My question is that the JSON I have to parse the IPAddr is not always the same. AND there are 50+ IPAddr= blocks... For example: > { > > "value" : { > > "IPAddr=10.1.1.12" : { > > "ReplyTime" : { > > "minTime" : 0, > > "maxTime" : 0, > > "averageTime" : 0 > > } > > }, > > "IPAddr=10.1.1.145" : { "ReplyTime" : { "minTime" : 0, "maxTime" : 0, "averageTime" : 0 } } (Keep adding blocks after this....) } } How would I setup a struct for something like this? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.