Open
Description
What is the problem
If I try to call Set
on an array jsonparser always replaces the first element of the array, regardless of the index passed
How to replicate
myJSON := []byte(`{}`)
myJSON, _ = jsonparser.Set(myJSON, []byte("1"), "test", "[0]")
myJSON, _ = jsonparser.Set(myJSON, []byte("2"), "test", "[1]")
myJSON, _ = jsonparser.Set(myJSON, []byte("3"), "test", "[2]")
fmt.Println(string(myJSON))
Expected output
{"test":[1,2,3]}
Actual output
{"test":[3]}
Metadata
Metadata
Assignees
Labels
No labels