nogoroutine

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
var Analyzer = &analysis.Analyzer{
	Name: "nogoroutine",
	Doc:  "禁止生产代码直接使用裸 go 语句;后台任务请改用 reg.Worker 托管生命周期",
	Run:  run,
}

Analyzer 是 nogoroutine 检查器。

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL