Documentation
¶
Overview ¶
Package deferinloop implements a Go analysis linter that flags defer statements placed directly inside for or range loop bodies. A defer inside a loop does not execute at the end of each iteration — it runs when the enclosing function returns, which can cause resource leaks and unexpected cleanup ordering.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = analyzerutil.New("deferinloop", "reports defer statements enclosed anywhere within a for or range loop body; a function literal between a defer and an enclosing loop is treated as a new scope boundary, making the defer exempt; test files are not checked", run)
Analyzer is the defer-in-loop analysis pass.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.