# panic: sync: negative WaitGroup counter

- **ID:** `go/waitgroup-negative-counter`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Calling Done() more times than Add(), causing the WaitGroup counter to go negative.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Ensure Add is called before starting goroutines and Done is called exactly once per goroutine.
   ```
2. **** (90% success)
   ```
   Use a defer statement right after Add to guarantee Done is called.
   ```

## Dead Ends

- **** — The panic will crash the program; ignoring is not possible. (100% fail)
- **** — This masks the bug and may cause Wait() to return prematurely. (80% fail)
- **** — If Add is not called, Done will still decrement and may go negative. (70% fail)
