This new method Value() will allows your access JSON native data and its type, instead of string.
{
"name":"John",
"age":31,
"female":false
}
After:
doc, _:= jsonquery.Parse(s)
for _, n := range doc.ChildNodes() {
fmt.Printf("%s: %v[%T]\n", n.Data, n.Value(), n.Value())
}
// Output:
age: 31[float64]
female: false[bool]
name: John[string]
Before:
doc, _:= jsonquery.Parse(s)
for _, n := range doc.ChildNodes() {
fmt.Printf("%s: %v[%T]\n", n.Data, n.InnerText(), n.InnerText())
}
// Output :
age: 31[string]
female: false[string]
name: John[string]
some discuss on here: antchfx/xpath#77
This new method
Value()will allows your access JSON native data and its type, instead of string.{ "name":"John", "age":31, "female":false }After:
// Output:
Before:
// Output :
some discuss on here: antchfx/xpath#77