# fatal error: concurrent slice append

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

## Root Cause

Multiple goroutines append to the same slice concurrently without synchronization, causing data races and potential panics.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   var mu sync.Mutex; mu.Lock(); slice = append(slice, item); mu.Unlock()
   ```
2. **** (90% success)
   ```
   ch := make(chan int); go func() { for v := range ch { slice = append(slice, v) } }()
   ```

## Dead Ends

- **** — If slice is also accessed directly, race persists. (70% fail)
- **** — Atomic operations don't help with slice growth; underlying array may be replaced. (85% fail)
