Parse Json

Retrieve json field value without proper defining struct in Go

using type assertion.

Photo by Fotis Fotopoulos on Unsplash

For example you want to retrieve variant_id from this json

"_shards": {
"total": 20,
"successful": 20,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 150798,
"max_score": 6.5599113,
"hits"…