sjson icon indicating copy to clipboard operation
sjson copied to clipboard

Set JSON values very quickly in Go

Results 41 sjson issues
Sort by recently updated
recently updated
newest added

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

great project, thanks for your contribution to open source! i'm consistently experiencing some unusual behavior when setting byte values (the impacted code is [here](https://github.com/tidwall/sjson/blob/133db2881f4d53a2513463f3dcdcbd6a1ae6639d/sjson.go#L674-L676) and [here](https://github.com/tidwall/sjson/blob/133db2881f4d53a2513463f3dcdcbd6a1ae6639d/sjson.go#L126)): when byte values are...

```go type StudentInfo struct { StudentId string `json:"student_id"` Class []string `json:"class"` } type Item struct { StudentInfo []*StudentInfo `json:"student_info"` } func main() { item := &Item{ []*StudentInfo{ { StudentId: "1",...

need to set multiple values for an array of objects ``` package main import ( "fmt" "github.com/tidwall/sjson" ) const jsondata = `{"data":[]}` func main() { data := make([]string, 0) data...

```Go dest := "[]" r := gjson.Get(source, "[a, b]" dest = sjson.Set(dest, ".-1", r.String()) ``` r is something like *["a_value","b_value"]* and gets inserted into dest as *[[["a_value","b_value"]]]* How can I...

Hi @tidwall I'm using this library to enrich event without unmarshalling into Go struct, and there's seems to be a memory problem in sjson.Set(). This is how I use it:...

Hi, i am the json funner, it's a very good library. but when i use it, there is a problem about sort json objects so i need your help. thank...

sjson.Set(b.content, path, []uint8{1, 2, 3, 4}) value type "[]uint8" will change to "string"

> When a type is not recognized, SJSON will fallback to the encoding/json Marshaller. The standard json library doesn't support type registration, so it's not very ideal to handle complex...