Merge pull request #570 from xushiwei/x

cjson.ParseString demo
This commit is contained in:
xushiwei
2024-07-26 16:44:13 +08:00
committed by GitHub

View File

@@ -23,6 +23,19 @@ func main() {
mod.SetItem(c.Str("items"), syms)
cstr := mod.CStr()
str := c.GoString(cstr)
c.Printf(c.Str("%s\n"), cstr)
cjson.FreeCStr(cstr)
mod.Delete()
cjsonLoad(str)
}
func cjsonLoad(str string) {
mod := cjson.ParseString(str)
cstr := mod.Print()
c.Printf(c.Str("%s\n"), cstr)
cjson.FreeCStr(cstr)