]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix bug introduced in CL 264537
authorRuss Cox <rsc@golang.org>
Tue, 27 Oct 2020 14:41:25 +0000 (10:41 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 27 Oct 2020 15:11:50 +0000 (15:11 +0000)
Shadowing bug noted after submit by Tom Thorogood.

Change-Id: I5f40cc3863dcd7dba5469f8530e9d0460e7c3e7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/265537
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/go/internal/fsys/fsys.go

index 3275c3faf7855c3577aa600df30c61583e513a85..5a8b36e2bcc1faf23fc627608bc7bc87e23a2976 100644 (file)
@@ -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 {