cmd/godoc: do not apply package path restrictions onto GOROOT when indexing.
Fixes golang/go#6925. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/156540043
This commit is contained in:
parent
5f5b110a59
commit
b916c559e7
|
@ -179,9 +179,12 @@ func (c *Corpus) newDirectory(root string, maxDepth int) *Directory {
|
||||||
case err != nil:
|
case err != nil:
|
||||||
log.Printf("newDirectory(%s): %s", root, err)
|
log.Printf("newDirectory(%s): %s", root, err)
|
||||||
return nil
|
return nil
|
||||||
case !isPkgDir(d):
|
case root != "/" && !isPkgDir(d):
|
||||||
log.Printf("newDirectory(%s): not a package directory", root)
|
log.Printf("newDirectory(%s): not a package directory", root)
|
||||||
return nil
|
return nil
|
||||||
|
case root == "/" && !d.IsDir():
|
||||||
|
log.Printf("newDirectory(%s): not a directory", root)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
if maxDepth < 0 {
|
if maxDepth < 0 {
|
||||||
maxDepth = 1e6 // "infinity"
|
maxDepth = 1e6 // "infinity"
|
||||||
|
|
Loading…
Reference in New Issue