rest - Golang: Json from URL as map -


what best way extract json url i.e. rest service go? seems rest client libraries in go force use of json.marshall needs struct used it.

this doesn't work in case of unstructured data don't know coming in. there way have come in map[string:string]?

why not parse map[string]string code have do

var d map[string]interface{} data, err := json.unmarshal(apiresponse, &d) 

you can traverse data in struct too.

if suspect, api response can not singular object, collection of objects, interface{} works arrays.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -