var doc … var Analyzer … func run(pass *analysis.Pass) (interface{ … } type deadState … // findLabels gathers information about the labels defined and used by stmt // and about which statements break, whether a label is involved or not. func (d *deadState) findLabels(stmt ast.Stmt) { … } // findDead walks the statement looking for dead code. // If d.reachable is false on entry, stmt itself is dead. // When findDead returns, d.reachable tells whether the // statement following stmt is reachable. func (d *deadState) findDead(stmt ast.Stmt) { … }