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 iterating object with 'k-v mappings'?

mthhk opened this issue · comments

commented

example code:

jsonObj:=fastjson.MustParse(`{"key":"value"}`)
for key,value := range jsonObj.toMap() {
// .....
}

Did you find an answer to this? I'd also be interested in finding out.

@misterr8472 , use Object.Visit for iterating over object entries.

Thank you! Works a treat :)