goroutinefanout

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package goroutinefanout detects goroutine launches repeated by loops without a statically proven organization-approved bound.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer, _ = New(Options{})

Analyzer is inactive until package policies are configured.

View Source
var Rule = shared.Rule{
	ID:                ruleID,
	Category:          shared.CategoryLifecycle,
	Severity:          shared.SeverityWarning,
	DefaultStatus:     shared.StatusAdvisory,
	Rationale:         "Loop-driven goroutine launches can make concurrency scale with untrusted or unbounded work.",
	Remediation:       "Use a fixed worker pool, a proven bounded semaphore, or synchronous per-iteration completion.",
	IntroducedVersion: "0.1.0",
	Configuration: shared.ConfigurationSchema{Properties: map[string]shared.ConfigurationProperty{
		"goroutine_fanout": {
			Type:        shared.ConfigurationArray,
			Description: "Package trees and maximum statically expanded goroutine launches.",
		},
	}},
}

Rule is the stable metadata for goroutine fan-out policy.

Functions

func New

func New(options Options) (*analysis.Analyzer, error)

New validates fan-out policy and constructs an analyzer.

Types

type Options

type Options struct {
	Policies []Policy
}

Options configures package fan-out limits.

type Policy

type Policy struct {
	Package   string
	MaxStatic int
}

Policy opts one package or trailing /... tree into fan-out enforcement.

Jump to

Keyboard shortcuts

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