From 69496a22682108bed606d4d509cfa3253f0cac3b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 27 Oct 2020 10:41:25 -0400 Subject: cmd/go: fix bug introduced in CL 264537 Shadowing bug noted after submit by Tom Thorogood. Change-Id: I5f40cc3863dcd7dba5469f8530e9d0460e7c3e7e Reviewed-on: https://go-review.googlesource.com/c/go/+/265537 Trust: Russ Cox Run-TryBot: Russ Cox Reviewed-by: Jay Conrod TryBot-Result: Go Bot --- src/cmd/go/internal/fsys/fsys.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/internal/fsys/fsys.go b/src/cmd/go/internal/fsys/fsys.go index 3275c3faf7..5a8b36e2bc 100644 --- a/src/cmd/go/internal/fsys/fsys.go +++ b/src/cmd/go/internal/fsys/fsys.go @@ -378,7 +378,8 @@ func IsDirWithGoFiles(dir string) (bool, error) { // But it's okay if the file is a symlink pointing to a regular // file, so use os.Stat to follow symlinks and check that. actualFilePath, _ := OverlayPath(filepath.Join(dir, fi.Name())) - if fi, err := os.Stat(actualFilePath); err == nil && fi.Mode().IsRegular() { + fi, err := os.Stat(actualFilePath) + if err == nil && fi.Mode().IsRegular() { return true, nil } if err != nil && firstErr == nil { -- cgit v1.2.3-54-g00ecf