tidwall / sjson

Set JSON values very quickly in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hi,It will fail when the key is a string convert from int,How to solve it?

lxyhust2018 opened this issue · comments

the code is like this,it will hold till time out.
val := "val"
key := "123"
res,_ := sjson.Set(res,key,val)

Hi, it seems that my code running well when i tried this :

number, _ := sjson.Set(`{"number": 23}`, "23", "number")
println(number)
//result : {"number": 23,"23":"number"}

you need to change res input to another string. Your res input is not yet declared