syncs: delete Map.Range, update callers to iterators

Updates #11038

Change-Id: I2819fed896cc4035aba5e4e141b52c12637373b1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-10-09 13:48:18 -07:00
committed by Brad Fitzpatrick
parent 2cadb80fb2
commit c763b7a7db
5 changed files with 11 additions and 32 deletions

View File

@@ -160,10 +160,9 @@ func TestMap(t *testing.T) {
}
got := map[string]int{}
want := map[string]int{"one": 1, "two": 2, "three": 3}
m.Range(func(k string, v int) bool {
for k, v := range m.All() {
got[k] = v
return true
})
}
if d := cmp.Diff(got, want); d != "" {
t.Errorf("Range mismatch (-got +want):\n%s", d)
}
@@ -178,10 +177,9 @@ func TestMap(t *testing.T) {
m.Delete("noexist")
got = map[string]int{}
want = map[string]int{}
m.Range(func(k string, v int) bool {
for k, v := range m.All() {
got[k] = v
return true
})
}
if d := cmp.Diff(got, want); d != "" {
t.Errorf("Range mismatch (-got +want):\n%s", d)
}