Skip to content

Commit

Permalink
unused: don't crash in whole-program mode if no packages were analyzed
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed Apr 27, 2019
1 parent aa43d95 commit 6f1f542
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions unused/unused.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,10 @@ func (c *Checker) results() []types.Object {
var out []types.Object

if c.WholeProgram {
if c.graph == nil {
// We never analyzed any packages
return nil
}
var ifaces []*types.Interface
var notIfaces []types.Type

Expand Down

0 comments on commit 6f1f542

Please sign in to comment.