๐ŸRace Detector WorkshopWORKSHOP
1
2
3
4

Step 1

The code below has a data race on `counter`. Run it mentally โ€” two goroutines write without synchronisation. Fix it by wrapping the increment with a `sync.Mutex`. Use `mu.Lock()` / `mu.Unlock()` (or `defer mu.Unlock()`). Print the final value after `wg.Wait()`.

โŒ˜ Enter (Mac) ยท Ctrl+Enter (Win/Linux)