# 错误：运行时检测到 goroutine 泄漏：time.Tick 从未停止

- **ID:** `go/goroutine-leak-time-tick`
- **领域:** go
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

time.Tick 返回的通道永远不会被垃圾回收；每次调用都会为进程生命周期泄漏一个 goroutine。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.18 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   t := time.NewTicker(time.Second)
defer t.Stop()
for range t.C { /* ... */ }
   ```
2. **** (90% 成功率)
   ```
   timer := time.AfterFunc(time.Second, func() { /* ... */ })
defer timer.Stop()
   ```

## 无效尝试

- **** — Each new ticker adds a goroutine; long-running services leak unboundedly. (90% 失败率)
- **** — time.Tick's underlying ticker is intentionally retained by the runtime. (95% 失败率)
