# WARNING: DATA RACE

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

## Root Cause

Two goroutines access the same memory location concurrently, at least one is a write, without synchronization. Detected by -race build.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   var mu sync.Mutex
mu.Lock()
shared++
mu.Unlock()
   ```
2. **** (92% success)
   ```
   var n int64
atomic.AddInt64(&n, 1)
   ```

## Dead Ends

- **** — Hides the bug; corrupted state and crashes still occur in production. (90% fail)
- **** — Go has no volatile; atomic fences alone don't fix logical races. (80% fail)
