Recently, I was analyzing some initialization code in Go with a teammate. The value being initialized was meant to be used in concurrent Go, so initialization had some requirement of atomicity. The code essentially boiled down to:
func (t *T) Start() {
if atomic.LoadInt32(&t.State) == Started {
return // Early Exit …