@@ -36,13 +36,13 @@ const (
36
36
)
37
37
38
38
// LookupAll only returns those Candidates whose import path
39
- // finds all the nms .
40
- func (ix * Index ) LookupAll (pkg string , names ... string ) map [string ][]Candidate {
39
+ // finds all the names .
40
+ func (ix * Index ) LookupAll (pkgName string , names ... string ) map [string ][]Candidate {
41
41
// this can be made faster when benchmarks show that it needs to be
42
42
names = uniquify (names )
43
43
byImpPath := make (map [string ][]Candidate )
44
44
for _ , nm := range names {
45
- cands := ix .Lookup (pkg , nm , false )
45
+ cands := ix .Lookup (pkgName , nm , false )
46
46
for _ , c := range cands {
47
47
byImpPath [c .ImportPath ] = append (byImpPath [c .ImportPath ], c )
48
48
}
@@ -67,9 +67,9 @@ func uniquify(in []string) []string {
67
67
68
68
// Lookup finds all the symbols in the index with the given PkgName and name.
69
69
// If prefix is true, it finds all of these with name as a prefix.
70
- func (ix * Index ) Lookup (pkg , name string , prefix bool ) []Candidate {
71
- loc , ok := slices .BinarySearchFunc (ix .Entries , pkg , func (e Entry , pkg string ) int {
72
- return strings .Compare (e .PkgName , pkg )
70
+ func (ix * Index ) Lookup (pkgName , name string , prefix bool ) []Candidate {
71
+ loc , ok := slices .BinarySearchFunc (ix .Entries , pkgName , func (e Entry , pkg string ) int {
72
+ return strings .Compare (e .PkgName , pkgName )
73
73
})
74
74
if ! ok {
75
75
return nil // didn't find the package
@@ -78,7 +78,7 @@ func (ix *Index) Lookup(pkg, name string, prefix bool) []Candidate {
78
78
// loc is the first entry for this package name, but there may be several
79
79
for i := loc ; i < len (ix .Entries ); i ++ {
80
80
e := ix .Entries [i ]
81
- if e .PkgName != pkg {
81
+ if e .PkgName != pkgName {
82
82
break // end of sorted package names
83
83
}
84
84
nloc , ok := slices .BinarySearchFunc (e .Names , name , func (s string , name string ) int {
@@ -105,7 +105,7 @@ func (ix *Index) Lookup(pkg, name string, prefix bool) []Candidate {
105
105
continue // should never happen
106
106
}
107
107
px := Candidate {
108
- PkgName : pkg ,
108
+ PkgName : pkgName ,
109
109
Name : flds [0 ],
110
110
Dir : string (e .Dir ),
111
111
ImportPath : e .ImportPath ,
0 commit comments