From aa43d956d36fabaecb1e334aa19387f6be5c0529 Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Sat, 27 Apr 2019 23:55:37 +0200 Subject: [PATCH] unused: actually keep track of packages --- unused/unused.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unused/unused.go b/unused/unused.go index 7b3433115..454c78e53 100644 --- a/unused/unused.go +++ b/unused/unused.go @@ -424,6 +424,7 @@ func NewChecker() *Checker { c := &Checker{ seen: map[token.Position]struct{}{}, initialPackages: map[*types.Package]struct{}{}, + allPackages: map[*types.Package]struct{}{}, } return c @@ -456,6 +457,7 @@ func (c *Checker) Run(pass *analysis.Pass) (interface{}, error) { visit(imp) } } + visit(pass.Pkg) c.fset = pass.Fset ssapkg := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA)