closecheck

command
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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 ./...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL