Closed tjasko closed 3 years ago
Given the following JSON:
{"values":[["test"]]}
Attempting to get the value of "test" via the values[0][0] path fails.
"test"
values[0][0]
Example program:
package main import ( "fmt" "github.com/stretchr/objx" ) func main() { d := objx.MustFromJSON(`{"values":[["test"]]}`) // Returns "[]interface {}{"test"}". fmt.Println(d.Get("values[0]").String()) // Returns empty string. fmt.Println(d.Get("values[0][0]").String()) }
The expected result would be for d.Get("values[0][0]").String() to return test.
d.Get("values[0][0]").String()
test
Given the following JSON:
Attempting to get the value of
"test"
via thevalues[0][0]
path fails.Example program:
The expected result would be for
d.Get("values[0][0]").String()
to returntest
.