github stretchr/objx v0.8.0

4 hours ago

New features

  • Map.Delete removes values by selector. It takes one or more selectors in the same dot and bracket notation as Get and Set, 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 ([]string stays []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 #174

New Contributors

Full Changelog: v0.7.0...v0.8.0

Don't miss a new objx release

NewReleases is sending notifications on new releases.