1
0
mirror of https://github.com/golang/go synced 2024-11-05 16:06:10 -07:00

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:
Andriy Lytvynov 2014-10-23 09:34:01 -07:00 committed by Brad Fitzpatrick
parent 5f5b110a59
commit b916c559e7

View File

@ -179,9 +179,12 @@ func (c *Corpus) newDirectory(root string, maxDepth int) *Directory {
case err != nil:
log.Printf("newDirectory(%s): %s", root, err)
return nil
case !isPkgDir(d):
case root != "/" && !isPkgDir(d):
log.Printf("newDirectory(%s): not a package directory", root)
return nil
case root == "/" && !d.IsDir():
log.Printf("newDirectory(%s): not a directory", root)
return nil
}
if maxDepth < 0 {
maxDepth = 1e6 // "infinity"