mirror of
https://github.com/golang/go
synced 2024-11-18 13:54:59 -07:00
re
This commit is contained in:
parent
633026453c
commit
6cd811b186
@ -260,10 +260,9 @@ func (d *parseDoc) lookupPkg(pkg string) (importPath string, ok bool) {
|
||||
}
|
||||
|
||||
func isStdPkg(path string) bool {
|
||||
_, ok := sort.Find(len(stdPkgs), func(i int) int {
|
||||
return strings.Compare(path, stdPkgs[i])
|
||||
})
|
||||
return ok
|
||||
// TODO: Use slices.BinarySearch when possible.
|
||||
i := sort.Search(len(stdPkgs), func(i int) bool { return stdPkgs[i] >= path })
|
||||
return i < len(stdPkgs) && stdPkgs[i] == path
|
||||
}
|
||||
|
||||
// DefaultLookupPackage is the default package lookup
|
||||
|
Loading…
Reference in New Issue
Block a user