From b916c559e7c49356c21f5e3ae6f2bdf7bd169896 Mon Sep 17 00:00:00 2001 From: Andriy Lytvynov Date: Thu, 23 Oct 2014 09:34:01 -0700 Subject: [PATCH] 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 --- godoc/dirtrees.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/godoc/dirtrees.go b/godoc/dirtrees.go index af8b02f0..a55b324f 100644 --- a/godoc/dirtrees.go +++ b/godoc/dirtrees.go @@ -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"