bitly / go-simplejson

a Go package to interact with arbitrary JSON
MIT License
3.76k stars 498 forks source link

how can i convert json to string #81

Closed justinling89 closed 5 years ago

justinling89 commented 5 years ago

i have string teststring := {"fields_desc": {"cpUin": "44444" }} js,_ := simplejson.NewJson([]byte(teststring))

my question is how can i convert js to string? i use js.string(), but i get "".

justinling89 commented 5 years ago

ok i have resolve it

justinling89 commented 5 years ago
js,_ := simplejson.NewJson([]byte(teststring)
js.Get("data").Get("10033490").Del("channelname")
json,_ := json.Marshal(js)
str := string(json)
so  str is my  goal string