go/build has no logic for reading the GOENV file, so it will ignore any GOPATH setting there.
|
func defaultGOPATH() string { |
|
env := "HOME" |
|
if runtime.GOOS == "windows" { |
|
env = "USERPROFILE" |
|
} else if runtime.GOOS == "plan9" { |
|
env = "home" |
|
} |
|
if home := os.Getenv(env); home != "" { |
|
def := filepath.Join(home, "go") |
|
if filepath.Clean(def) == filepath.Clean(runtime.GOROOT()) { |
|
// Don't set the default GOPATH to GOROOT, |
|
// as that will trigger warnings from the go tool. |
|
return "" |
|
} |
|
return def |
|
} |
|
return "" |
|
} |
go/buildhas no logic for reading theGOENVfile, so it will ignore anyGOPATHsetting there.go/src/go/build/build.go
Lines 275 to 292 in 7eb5941