In gobyexample.com/json, a few examples show how to decode json
string into typed objects or dictionary objects, which are declared as map[string]interface{}
. But it assumes the result is always a dictionary.
So my question is how to determine the type of json
object and what is the best practice to handle that?