# panic: runtime error: send on closed channel (ticker.C)

- **ID:** `go/goroutine-ticker-stop-leak`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Using a time.Ticker after it has been stopped, causing a send on a closed channel if the ticker fires.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.18 | active | — | — |
| 1.19 | active | — | — |
| 1.20 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **Stop ticker and drain channel before closing** (90% success)
   ```
   ticker.Stop(); ticker.C = nil // or use select with done channel
   ```
2. **Use time.NewTicker with a done channel** (95% success)
   ```
   done := make(chan struct{}); go func() { for { select { case <-ticker.C: // handle case <-done: return } } }()
   ```

## Dead Ends

- **Ignoring ticker stop** — Causes goroutine leak and potential panic. (90% fail)
- **Using recover() to catch panic** — Does not prevent data race on ticker.C. (85% fail)
