From 7b211bb5cae7cfd05a192780aaed4f2282619d9f Mon Sep 17 00:00:00 2001 From: Pure White Date: Mon, 24 Aug 2020 16:05:36 +0800 Subject: [PATCH] doc: keys of sync.Map will never be deleted Keys of sync.Map will never be deleted, this behaviour isn't the same as the native map. We should document this clearly. Fixes #40999 . --- src/sync/map.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sync/map.go b/src/sync/map.go index a61e2ebdd67f7..2a1484f18d951 100644 --- a/src/sync/map.go +++ b/src/sync/map.go @@ -24,6 +24,7 @@ import ( // contention compared to a Go map paired with a separate Mutex or RWMutex. // // The zero Map is empty and ready for use. A Map must not be copied after first use. +// Keys in the Map will never be deleted, thus they will never be garbage collected. type Map struct { mu Mutex