mirror of
https://github.com/golang/go
synced 2024-11-27 03:21:18 -07:00
cmd/go/internal/modload: skip go.mod directories on all systems, not just Plan 9
I see no reason Plan 9 should be special cased. A directory named go.mod is not useful on any system. Followup to CL 129804. Change-Id: I9cc91b5934b17650bfdb07370aa73aeae445968c Reviewed-on: https://go-review.googlesource.com/c/149337 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
43edf21eff
commit
b075dfba80
@ -25,7 +25,6 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
@ -402,7 +401,7 @@ func FindModuleRoot(dir, limit string, legacyConfigOK bool) (root, file string)
|
||||
|
||||
// Look for enclosing go.mod.
|
||||
for {
|
||||
if fi, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil && !(runtime.GOOS == "plan9" && fi.IsDir()) {
|
||||
if fi, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil && !fi.IsDir() {
|
||||
return dir, "go.mod"
|
||||
}
|
||||
if dir == limit {
|
||||
@ -420,7 +419,7 @@ func FindModuleRoot(dir, limit string, legacyConfigOK bool) (root, file string)
|
||||
dir = dir1
|
||||
for {
|
||||
for _, name := range altConfigs {
|
||||
if fi, err := os.Stat(filepath.Join(dir, name)); err == nil && !(runtime.GOOS == "plan9" && fi.IsDir()) {
|
||||
if fi, err := os.Stat(filepath.Join(dir, name)); err == nil && !fi.IsDir() {
|
||||
return dir, name
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user