stretchr / objx

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

Feature request: delete keys from a Map by selector #141

Open dgunay opened 1 year ago

dgunay commented 1 year ago

I found myself wanting to do something like this

m := objx.New(data)
m.Delete("foo.bar")

But didn't see any way of doing that without casting back to map[string]any and doing it myself. It would be nice to have this. I worked around it by using m.Set("foo.bar", nil), but that may not work for other peoples' use cases.