Closed becheran closed 1 year ago
An empty path is valid and will return the value for an empty key in an object.
gjson.Get(`{ "": "hi" }`, "").String() == "hi"
gjson.Get(`{ "": { "inner": "hi" } }`, ".inner").String() == "hi"
@tidwall ah got it. Thx for the fast response and clarification!
Are empty paths are also supported? I don't really find an answer to the question in the path documentation. The following test fails for me, but I would have expected it to succeed if empty paths would have been allowed? I Would have expected that for empty paths the full json payload would be interpreted.