valyala / fastjson

Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get a map from Value type

seanlook opened this issue · comments

commented

I can't find any API that convert Value to a map, just like gson does:

m, ok := gjson.Parse(json).Value().(map[string]interface{})

There is no such API. Use Object.Visit for iterating over all the items in the object or Object.Get for obtaining value by key.

commented

Ok, I'll try it. Thanks.