The repository contains the materials from my GopherCon 2021 talk Writing a Static Analyzer for Go Code.
Inside the closecheck directory is the source to an *analysis.Analyzer, whose driver command is in main.go
rules.go contains a ruleguard pattern for detecting double closes.