3 ms·
Seems odd not to mention sync.Map at least in passing.
by kasey_junk 8y ago
Seems odd not to mention sync.Map at least in passing.
- geoka9 8y agoIt's got a lot of gotchas and is not intended to be a simple replacement for map+mutex (certainly not in this case).
- blaisio 8y agoActually, this is exactly a scenario in which a sync.Map would be useful. Typically, you would use pointers to atomic integers as the sync.Map values in a case like this.