tidwall / sjson

Set JSON values very quickly in Go
MIT License
2.4k stars 165 forks source link

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

Open lxyhust2018 opened 2 years ago

lxyhust2018 commented 2 years ago

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

Faridalim commented 2 years ago

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