1
0
mirror of https://github.com/golang/go synced 2024-11-18 06:44:49 -07:00

cmd/doc: continue searching after error reading directory

If a directory in GOPATH is unreadable, we should keep looking for other
packages. Otherwise we can give the misleading error "no buildable Go
source files".

Fixes #16240

Change-Id: I38e1037f56ec463d3c141f0508fb74211cb90f13
Reviewed-on: https://go-review.googlesource.com/31713
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Quentin Smith 2016-10-21 16:48:50 -04:00
parent 8419c85eaa
commit 699fb0fc5b

View File

@ -77,14 +77,14 @@ func (d *Dirs) bfsWalkRoot(root string) {
for _, dir := range this {
fd, err := os.Open(dir)
if err != nil {
log.Printf("error opening %s: %v", dir, err)
return // TODO? There may be entry before the error.
log.Print(err)
continue
}
entries, err := fd.Readdir(0)
fd.Close()
if err != nil {
log.Printf("error reading %s: %v", dir, err)
return // TODO? There may be entry before the error.
log.Print(err)
continue
}
hasGoFiles := false
for _, entry := range entries {