stretchr / objx

Go package for dealing with maps, slices, JSON and other data.
MIT License
687 stars 75 forks source link

Feature Request: `GetStrict` method #111

Closed ghostsquad closed 1 year ago

ghostsquad commented 2 years ago

I desire a method that attempts to get a subkey without parsing the key value I'm providing. I'm not sure how to do that currently.

geseq commented 2 years ago

Do you mean something like: m.Get(key).Inter()

If not can you provide an example of what you mean? I’m not entirely sure I understand.

ghostsquad commented 2 years ago

I don't want the parameter of Get to be interpreted as a selector. It may contain periods and other characters in that realm.

geseq commented 2 years ago

There isn’t a way to do that at the moment. However, you can change the PathSeparator and use a separator that works for you.

If you still need the strict getter, please feel free to create a PR.