MCPcopy Create free account
hub / github.com/benbjohnson/immutable / ExampleMapBuilder_Delete

Function ExampleMapBuilder_Delete

immutable_test.go:1573–1588  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1571}
1572
1573func ExampleMapBuilder_Delete() {
1574 b := NewMapBuilder[string, any](nil)
1575 b.Set("foo", "bar")
1576 b.Set("baz", 100)
1577 b.Delete("baz")
1578
1579 m := b.Map()
1580 v, ok := m.Get("foo")
1581 fmt.Println("foo", v, ok)
1582
1583 v, ok = m.Get("baz")
1584 fmt.Println("baz", v, ok)
1585 // Output:
1586 // foo bar true
1587 // baz <nil> false
1588}
1589
1590func TestInternalSortedMapLeafNode(t *testing.T) {
1591 RunRandom(t, "NoSplit", func(t *testing.T, rand *rand.Rand) {

Callers

nothing calls this directly

Calls 4

MapMethod · 0.80
SetMethod · 0.45
DeleteMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…