I have a need to unmarshal a json object that has values that can change. A typical object would have as an example the following properties defined:
{
"entityName": "example Property",
"properties": [
{
"name": "property1",
"type": "string",
"value": "Test Value"
},
{
"name": "property2",
"type": "float",
"value": "12.5"
},
{
"name": "property3",
"type": "integer",
"value": 1
}
]
}
Each property would declare itself as the type it would need to be unmarshalled to. I have solved this problem in Java using generics but I am unsure, how I would declare my object in Go?