Data Race Patterns in Go
Sorry to say, but these hit close to home for me.   A lot of the synchronization paradigms in Go are easy to misuse, but lead the author into thinking it&#x27;s okay.   the WaitGroup one is particularly poignant for me, since the race detector doesn&#x27;t catch it.<p>I&#x27;ll add one other data race goof: atomic.Value.  Look at the implementation.  Unlike pretty much every other language I&#x27;ve seen, atomic.Value isn&#x27;t really atomic, since the concrete type can&#x27;t ever change after being set.   This stems from fact that interfaces are two words rather than one, and they can&#x27;t be (hardware) atomically set.  To fix it, Go just documents &quot;hey, don&#x27;t do that&quot;, and then panics if you do.