| 2472 | } |
| 2473 | |
| 2474 | func 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. |
| 2492 | func RunRandom(t *testing.T, name string, fn func(t *testing.T, rand *rand.Rand)) { |