I have the following Json structure that I need to decode and I'm not sure the proper approach for unmarshalling it.
var b = []byte(`{
"Card:5417871461137421886": {
"applicationUUID": "5417871461137421886",
"commit": "test_commit",
"lastSeen": "test_lastSeen",
"localUUID": "E4:F5:13:8E:F5:43",
"progress": "3.5",
"externalUUID": "test_externalUUID",
"state": "test_state"
},
"Card:5417871461137421886.Color": {
"applicationUUID": "5417871461137421886",
"color": "blue"
}
}`)
My initial approach has been by somehow creating a structure then unmarshalling to the struct, but due to the dynamic nature I'm unsure how to accomplish this. One approach I've tried is using a parallel structure however I have not succeeded at making that work properly also. I'm kind of at a loss for a good way to solve this problem You can see my sample code here https://play.golang.org/p/mzMArgo8ta2
I can not change the structure of the Json because it is being read from an API. Ultimately I do not want or care about the unique field names, since the application ID is always listed as a value. If there would be a simple way to remove all the Card:Id I figure I could just map it like normal.