cmd/guru: fix assignment to entry in nil map.
Fixes golang/go#14746. Change-Id: Id79c43c7d3700b98c010aa7dc0aac2463164be09 Reviewed-on: https://go-review.googlesource.com/20988 Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
936084890a
commit
21cc49bd03
|
@ -175,6 +175,9 @@ func globalReferrers(q *Query, qpkg, defpkg string, objposn token.Position, isPk
|
|||
var users map[string]bool
|
||||
if isPkgLevel {
|
||||
users = rev[defpkg] // direct importers
|
||||
if users == nil {
|
||||
users = make(map[string]bool)
|
||||
}
|
||||
users[defpkg] = true // plus the defining package itself
|
||||
} else {
|
||||
users = rev.Search(defpkg) // transitive importers
|
||||
|
|
Loading…
Reference in New Issue