Skip to content

Commit 699fb0f

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Russ Cox <[email protected]> Reviewed-by: Rob Pike <[email protected]>
1 parent 8419c85 commit 699fb0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cmd/doc/dirs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ func (d *Dirs) bfsWalkRoot(root string) {
7777
for _, dir := range this {
7878
fd, err := os.Open(dir)
7979
if err != nil {
80-
log.Printf("error opening %s: %v", dir, err)
81-
return // TODO? There may be entry before the error.
80+
log.Print(err)
81+
continue
8282
}
8383
entries, err := fd.Readdir(0)
8484
fd.Close()
8585
if err != nil {
86-
log.Printf("error reading %s: %v", dir, err)
87-
return // TODO? There may be entry before the error.
86+
log.Print(err)
87+
continue
8888
}
8989
hasGoFiles := false
9090
for _, entry := range entries {

0 commit comments

Comments
 (0)