# 致命错误：并发读取和写入 map

- **ID:** `go/panic-concurrent-map-read-write`
- **领域:** go
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

一个 goroutine 读取 map 的同时另一个 goroutine 在写入，且没有同步保护。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.0+ | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   mu.RLock()
v := m[k]
mu.RUnlock()
   ```
2. **** (90% 成功率)
   ```
   var m sync.Map
if v, ok := m.Load(k); ok { _ = v }
   ```

## 无效尝试

- **** — Copy itself races with the writer; the fatal error still fires during copy. (85% 失败率)
- **** — Go does not serialize concurrent map access; runtime deliberately aborts. (95% 失败率)
