Commit b075dfba authored by Russ Cox's avatar Russ Cox

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
parent 43edf21e
......@@ -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
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment