Skip to content

Commit 583d586

Browse files
committed
sync: document behavior of Map.Delete when key is not present
Change-Id: I6a6a465631e91141a5fcc9c04a7df0dc47780731 Reviewed-on: https://go-review.googlesource.com/c/go/+/643955 Reviewed-by: Daniel McCarney <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Junyang Shao <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 3501186 commit 583d586

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/sync/hashtriemap.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func (m *Map) LoadAndDelete(key any) (value any, loaded bool) {
7474
}
7575

7676
// Delete deletes the value for a key.
77+
// If the key is not in the map, Delete does nothing.
7778
func (m *Map) Delete(key any) {
7879
m.m.Delete(key)
7980
}

0 commit comments

Comments
 (0)