...

Package lostcancel

import "cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel"
Overview
Index

Overview ▾

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

Index ▾

Package files

lostcancel.go

Constants

const Doc = `check cancel func returned by context.WithCancel is called

The cancelation 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.)`

Variables

var Analyzer = &analysis.Analyzer{
    Name: "lostcancel",
    Doc:  Doc,
    Run:  run,
    Requires: []*analysis.Analyzer{
        inspect.Analyzer,
        ctrlflow.Analyzer,
    },
}