I have a 3rd party function call that I can not modify which return me a interface{} and in res:
res, err := client.Client.Query(userPrincipal, query)
require.NoError(t, err)
fmt.Println(res)
out, _ := json.Marshal(res)
t.Error("Create Result: ", string(out))
I need to check the data of result, is it possible to get data from res without defining it's type?
Here is the result value:
map[driver:map[externalIds:[map[key:externalId1 value:1]] updatedAt:2022-09-24T16:10:50.280936Z]]
And here it is parsed in JSON:
{"driver":{"externalIds":[{"key":"externalId1","value":"1"}],"updatedAt":"2022-09-24T16:16:38.051185Z"}}
How can I get the externalIds and updatedAt values so I can check them? something like this would be ideal:
res.driver.externalIds.key == "externalId1"
res.updatedAt == "2022-09-24T16:16:38.051185Z"