diff options
author | Leonardo Comelli <leonardo.comelli@gmail.com> | 2019-03-19 03:53:04 +0000 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2019-03-28 21:59:51 +0000 |
commit | fa5dbd06e57475a6b788ebf0468c132ec9cd77fc (patch) | |
tree | 7921f8da175ea05b35af7cc244dc2387cd760b09 /src/cmd/go/internal/modload/search.go | |
parent | 93af67783796a48b3f59bd969dc0c528c37571ec (diff) | |
download | go-fa5dbd06e57475a6b788ebf0468c132ec9cd77fc.tar.gz go-fa5dbd06e57475a6b788ebf0468c132ec9cd77fc.zip |
cmd: ignore the directory named go.mod
The existing implementation does not check in all cases whether go.mod is a regular file.
Fixes #30788
Change-Id: I6d140545c3cfada651612efd5bee2fbdcb747ca7
GitHub-Last-Rev: 4a9b251e378d9d7cc8768d395c360d3542fc9bc6
GitHub-Pull-Request: golang/go#30830
Reviewed-on: https://go-review.googlesource.com/c/go/+/167393
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/search.go')
-rw-r--r-- | src/cmd/go/internal/modload/search.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/search.go b/src/cmd/go/internal/modload/search.go index 753b3be6de..3af39747c6 100644 --- a/src/cmd/go/internal/modload/search.go +++ b/src/cmd/go/internal/modload/search.go @@ -76,7 +76,7 @@ func matchPackages(pattern string, tags map[string]bool, useStd bool, modules [] } // Stop at module boundaries. if path != root { - if _, err := os.Stat(filepath.Join(path, "go.mod")); err == nil { + if fi, err := os.Stat(filepath.Join(path, "go.mod")); err == nil && !fi.IsDir() { return filepath.SkipDir } } |