From d35ce1add95e124ca43c5db8ce7f13972c74877a Mon Sep 17 00:00:00 2001 From: James Tucker Date: Thu, 27 Apr 2023 16:51:47 -0700 Subject: [PATCH] syncs: add documentation to Map.Range Updates #cleanup Signed-off-by: James Tucker --- syncs/syncs.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syncs/syncs.go b/syncs/syncs.go index 52fcad220..aa89486a4 100644 --- a/syncs/syncs.go +++ b/syncs/syncs.go @@ -208,6 +208,8 @@ func (m *Map[K, V]) Delete(key K) { delete(m.m, key) } +// Range iterates over the map in undefined order calling f for each entry. +// Iteration stops if f returns false. Map changes are blocked during iteration. func (m *Map[K, V]) Range(f func(key K, value V) bool) { m.mu.RLock() defer m.mu.RUnlock()