Skip to content

Commit

Permalink
doc: keys of sync.Map will never be deleted
Browse files Browse the repository at this point in the history
Keys of sync.Map will never be deleted, this behaviour isn't the same as the native map.
We should document this clearly.

Fixes golang#40999 .
  • Loading branch information
PureWhiteWu committed Aug 24, 2020
1 parent ffbd852 commit 0a09eed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sync/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 are never deleted, thus they will never be garbage collected.
type Map struct {
mu Mutex

Expand Down

0 comments on commit 0a09eed

Please sign in to comment.