New features
-
Map.Deleteremoves values by selector. It takes one or more selectors in the same dot and bracket notation asGetandSet, removes the map keys or slice elements they point to, and returns the map so calls can be chained:m.Delete("books[1].chapters[2].title", "draft")Selectors run in order, so after a slice element is removed, later selectors see the shifted indexes. Missing paths and out-of-range indexes are ignored. Removing a slice element builds a new slice of the same type (
[]stringstays[]string) and leaves the original backing array untouched. Maps along the path are modified in place. (#174)
What's Changed
- feat: add Delete method to Map by selector by @00200200 in https://github.com/stretchr/objx/pull/174
New Contributors
- @00200200 made their first contribution in https://github.com/stretchr/objx/pull/174
Full Changelog: https://github.com/stretchr/objx/compare/v0.7.0...v0.8.0