Skip to content

Commit e29f9ae

Browse files
committed
refactor/satisfy: check for presence of types.Info maps
Although Finder.Find's doc says that it requires certain maps in its argument types.Info, it didn't actually check. Now it does. Change-Id: I4938f9cbca9377b935d8a027d59438b9697558b7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/662698 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 17ce4c7 commit e29f9ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

refactor/satisfy/find.go

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ type Finder struct {
8484
// info.{Defs,Uses,Selections,Types} must have been populated by the
8585
// type-checker.
8686
func (f *Finder) Find(info *types.Info, files []*ast.File) {
87+
if info.Defs == nil || info.Uses == nil || info.Selections == nil || info.Types == nil {
88+
panic("Finder.Find: one of info.{Defs,Uses,Selections.Types} is not populated")
89+
}
8790
if f.Result == nil {
8891
f.Result = make(map[Constraint]bool)
8992
}

0 commit comments

Comments
 (0)