pkg/module: include SSH environments (#1164)

This commit is contained in:
Marwan Sulaiman
2019-03-28 13:54:36 -04:00
committed by GitHub
parent 20aeee6c76
commit 16c6b029ac
+15 -1
View File
@@ -167,9 +167,23 @@ func PrepareEnv(gopath string) []string {
noProxy := fmt.Sprintf("NO_PROXY=%s", os.Getenv("NO_PROXY"))
gopathEnv := fmt.Sprintf("GOPATH=%s", gopath)
cacheEnv := fmt.Sprintf("GOCACHE=%s", filepath.Join(gopath, "cache"))
gitSSH := fmt.Sprintf("GIT_SSH=%s", os.Getenv("GIT_SSH"))
gitSSHCmd := fmt.Sprintf("GIT_SSH_COMMAND=%s", os.Getenv("GIT_SSH_COMMAND"))
disableCgo := "CGO_ENABLED=0"
enableGoModules := "GO111MODULE=on"
cmdEnv := []string{pathEnv, homeEnv, gopathEnv, cacheEnv, disableCgo, enableGoModules, httpProxy, httpsProxy, noProxy}
cmdEnv := []string{
pathEnv,
homeEnv,
gopathEnv,
cacheEnv,
disableCgo,
enableGoModules,
httpProxy,
httpsProxy,
noProxy,
gitSSH,
gitSSHCmd,
}
// add Windows specific ENV VARS
if runtime.GOOS == "windows" {