# fatal error: concurrent map writes

- **ID:** `go/goroutine-race-on-map`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Multiple goroutines attempt to write to a map simultaneously without synchronization, causing a runtime panic.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   var mu sync.Mutex; mu.Lock(); myMap[key] = value; mu.Unlock()
   ```
2. **** (90% success)
   ```
   var sm sync.Map; sm.Store(key, value)
   ```

## Dead Ends

- **** — If not correctly implemented, channel can still cause races or deadlocks. (55% fail)
- **** — Race condition persists; timing is unreliable. (90% fail)
