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

Function ExampleSortedMap_Delete

immutable_test.go:2409–2423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2407}
2408
2409func ExampleSortedMap_Delete() {
2410 m := NewSortedMap[string, any](nil)
2411 m = m.Set("foo", "bar")
2412 m = m.Set("baz", 100)
2413 m = m.Delete("baz")
2414
2415 v, ok := m.Get("foo")
2416 fmt.Println("foo", v, ok)
2417
2418 v, ok = m.Get("baz")
2419 fmt.Println("baz", v, ok)
2420 // Output:
2421 // foo bar true
2422 // baz <nil> false
2423}
2424
2425func ExampleSortedMap_Iterator() {
2426 m := NewSortedMap[string, any](nil)

Callers

nothing calls this directly

Calls 3

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…