From 699fb0fc5b654b714d7e8be5628646c0b063d523 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Fri, 21 Oct 2016 16:48:50 -0400 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox Reviewed-by: Rob Pike --- src/cmd/doc/dirs.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd/doc/dirs.go b/src/cmd/doc/dirs.go index 2982eeeb10..a4ef8d2379 100644 --- a/src/cmd/doc/dirs.go +++ b/src/cmd/doc/dirs.go @@ -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 {