Help us shape the future of Go! Take the 2026 Go Developer Survey

contextcancelnotdeferred

package
v0.92.7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package contextcancelnotdeferred implements a Go analysis linter that flags context cancel functions called manually instead of deferred.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = resourcetracker.NewAnalyzer(resourcetracker.Config[types.Object]{
	Name:         "contextcancelnotdeferred",
	Doc:          "reports context cancel functions that are called directly instead of deferred",
	Message:      "context cancel function should be deferred immediately after context.WithCancel/WithTimeout/WithDeadline",
	Acquisitions: cancelFuncAcquisitions,
	CleanupKey:   cancelCallKey,
})

Analyzer is the context-cancel-not-deferred analysis pass.

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