Documentation
¶
Overview ¶
Package analyzer provides the deferrlint static analysis for Go code. It checks for incorrect usage of defer statements, specifically assignments to error-typed variables that are not named return values in deferred functions.
This analyzer is useful for catching potential bugs where a deferred function attempts to assign a value to an error variable that is expected to be a named return value, but isn't. This can help ensure that deferred functions behave as intended, and that error handling is consistent and predictable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Analyzer = &analysis.Analyzer{
Name: "deferrlint",
Doc: "reports when a deferred function assigns to an error-typed variable that is not a named return value",
Run: run,
URL: "github.com/jakobmoellerdev/deferrlint",
}
Analyzer reports when a deferred function assigns to an error-typed variable that is not a named return value.
Functions ¶
This section is empty.
Types ¶
This section is empty.