Documentation
¶
Overview ¶
Command closecheck is an SSA-based analyzer that flags io.Closer values returned from a call that are then dropped -- neither closed nor allowed to escape (returned, stored, or captured by a closure). unlike the ruleguard (AST) rules, this follows the value through the def-use graph, so it correctly ignores a closer that is returned several statements later or stashed in a struct field, while still catching the "drain it then leak it" footgun.
run it standalone (it is invoked by the `lint` make task):
go run ./test/linter/closecheck ./...
Click to show internal directories.
Click to hide internal directories.