mirror of https://github.com/golang/go.git
Merge 95efed774e into 49cdf0c42e
This commit is contained in:
commit
7c88425856
|
|
@ -553,6 +553,10 @@ func Init() {
|
|||
if !mustUseModules {
|
||||
return
|
||||
}
|
||||
} else if os.Getenv("GOMOD") != "" && filepath.Join(modRoot, "go.mod") != filepath.Join(modRoot, os.Getenv("GOMOD")) {
|
||||
// if GOMOD is set and does not point to module file, error as they must use -modfile
|
||||
// see golang.org/issue/51217
|
||||
base.Fatalf("go: GOMOD cannot be used to set the module file. use -modfile")
|
||||
} else {
|
||||
modRoots = []string{modRoot}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue