You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If use map, I can get the size of it by len(map). Whatever, how can I get the size of sync.Map?
What did you see instead?
Add function: func (m *Map) Len() int
Maybe Map should have a member "size int64". Map can change its value in Store & LoadOrStore & Delete by using atomic.AddInt64. And then (m Map) Len() can return m.size to get Map's size.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
What version of Go are you using (
go version
)?go 1.9 beta2
What did you expect to see?
If use map, I can get the size of it by len(map). Whatever, how can I get the size of sync.Map?
What did you see instead?
Add function: func (m *Map) Len() int
Maybe Map should have a member "size int64". Map can change its value in Store & LoadOrStore & Delete by using atomic.AddInt64. And then (m Map) Len() can return m.size to get Map's size.
The text was updated successfully, but these errors were encountered: