Closed Robert-M-Muench closed 2 years ago
Trying to use some Path()
which doesn't work:
var json = `["test@test.com","2019-04-01T11:33:39+02:00"]`
res := gjson.Get(json, "[@this].0.0")
fmt.Printf("1: %s %s\n", res.Raw, res.Path(json))
Nothing returned for the Path()
call.
An empty string is what Path
returns when it cannot determine the original path.
The documentation for Path
isn't clear, but the Result
must come from a path that does not use modifier, multipath, or nested queries.
I updated the comment:
https://github.com/tidwall/gjson/commit/56c0a0aa5b8ff73f36eab8cd0fa30465cea393d1
See: https://go.dev/play/p/C3RwPvdGLi1
Why isn't value changed to
"*"
but still is"test@test.com"
?I want to change the queried JSON part in place.