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

Function ExampleSortedMapBuilder_Delete

immutable_test.go:2474–2489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2472}
2473
2474func ExampleSortedMapBuilder_Delete() {
2475 b := NewSortedMapBuilder[string, any](nil)
2476 b.Set("foo", "bar")
2477 b.Set("baz", 100)
2478 b.Delete("baz")
2479
2480 m := b.Map()
2481 v, ok := m.Get("foo")
2482 fmt.Println("foo", v, ok)
2483
2484 v, ok = m.Get("baz")
2485 fmt.Println("baz", v, ok)
2486 // Output:
2487 // foo bar true
2488 // baz <nil> false
2489}
2490
2491// RunRandom executes fn multiple times with a different rand.
2492func RunRandom(t *testing.T, name string, fn 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…