lostcancel

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package lostcancel defines an Analyzer that checks for failure to call a context cancellation function.

Analyzer lostcancel

lostcancel: check cancel func returned by context.WithCancel is called

The cancellation function returned by context.WithCancel, WithTimeout, and WithDeadline must be called or the new context will remain live until its parent context is cancelled. (The background context is never cancelled.)

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "lostcancel",
	Doc:  analysisutil.MustExtractDoc(doc, "lostcancel"),
	URL:  "https://pkg.go.dev/github.com/TBD54566975/golang-tools/go/analysis/passes/lostcancel",
	Run:  run,
	Requires: []*analysis.Analyzer{
		inspect.Analyzer,
		ctrlflow.Analyzer,
	},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
lostcancel
The lostcancel command applies the github.com/TBD54566975/golang-tools/go/analysis/passes/lostcancel analysis to the specified packages of Go source code.
The lostcancel command applies the github.com/TBD54566975/golang-tools/go/analysis/passes/lostcancel analysis to the specified packages of Go source code.

Jump to

Keyboard shortcuts

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