You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am parsing JSON that uses a dot (".") for some key names. I've discovered that I could redefine the separator using gojsonq.SetSeparator("·") to a middle-dot, and then use fmt.Sprintf to define the path input to gojsonq.From.
What would be even better would be to avoid all of this, and just have From support multiple arguments, with each argument describing components of the path to the desired node. In this case, the separator can be ignored, and I don't have to use the middle dot setup as above.
For example, q.From("first.level.key.name", "data") would select the path:
first.level.key.name
data
where the first path component has dots in it, and the second path component does not.
Thanks for a great package! :D
I am parsing JSON that uses a dot (".") for some key names. I've discovered that I could redefine the separator using
gojsonq.SetSeparator("·")
to a middle-dot, and then usefmt.Sprintf
to define the path input togojsonq.From
.What would be even better would be to avoid all of this, and just have
From
support multiple arguments, with each argument describing components of the path to the desired node. In this case, the separator can be ignored, and I don't have to use the middle dot setup as above.For example,
q.From("first.level.key.name", "data")
would select the path:where the first path component has dots in it, and the second path component does not.
At the moment, I have to do the following:
The text was updated successfully, but these errors were encountered: