# WARNING: DATA RACE
Write at 0x... by goroutine N:
  main.foo()
Previous read at 0x... by goroutine M:
  main.bar()

- **ID:** `go/race-detector-warning`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Two goroutines accessed the same memory location without synchronization, at least one being a write. Detected only when built with -race.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.1+ | active | — | — |

## Workarounds

1. **** (97% success)
   ```
   var mu sync.Mutex
mu.Lock()
counter++
mu.Unlock()
// or
atomic.AddInt64(&counter, 1)
   ```
2. **** (92% success)
   ```
   for _, item := range items {
    item := item // capture by value
    go func() { process(item) }()
}
   ```

## Dead Ends

- **** — Does not create a happens-before relationship between the two accesses; race detector still fires. (90% fail)
- **** — Hides real bugs; production may corrupt data or crash non-deterministically. (95% fail)
