4 ms·
Go's race detector (-race) does an excellent job of catching data races without false positives, but it does not detect race conditions. This was my concern wi
by schmichael 7y ago
Go's race detector (-race) does an excellent job of catching data races without false positives, but it does not detect race conditions.
This was my concern with sync.Map being added to Go's standard library: I saw many Java developers use concurrent hashmaps to avoid data races while creating applications riddled with race conditions. Your critical section is rarely just the map.{get,set} but rather the operations performed with the objects you get/set.
Luckily I've seen sync.Map used very infrequently as Go's lack of generics make it fairly awkward.