Documentation
¶
Overview ¶
Package nogoroutine 禁止生产代码直接使用裸 `go` 语句启动协程。
在 appkit 域服务中,长驻或异步后台任务应通过 reg.Worker(name, run) 托管: 框架统一负责关停等待、超时控制与异常退出上报;裸 `go func()` 容易泄漏、 吞掉错误或在进程退出时被硬截断(见 AGENTS.md「惯用法」与 DESIGN §7)。
默认只查非生成生产代码(_test.go 与生成文件不查),-tests=true 连测试一起查。 确需并发 fan-out 等有界场景时,用 //appkit:ignore nogoroutine -- <理由> 显式豁免。
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Analyzer = &analysis.Analyzer{
Name: "nogoroutine",
Doc: "禁止生产代码直接使用裸 go 语句;后台任务请改用 reg.Worker 托管生命周期",
Run: run,
}
Analyzer 是 nogoroutine 检查器。
Functions ¶
This section is empty.
Types ¶
This section is empty.