mirror of https://github.com/golang/go.git
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 <daniel@binaryparadox.net> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
350118666d
commit
583d586ef9
|
|
@ -74,6 +74,7 @@ func (m *Map) LoadAndDelete(key any) (value any, loaded bool) {
|
|||
}
|
||||
|
||||
// Delete deletes the value for a key.
|
||||
// If the key is not in the map, Delete does nothing.
|
||||
func (m *Map) Delete(key any) {
|
||||
m.m.Delete(key)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue