Added missing environment variables to command, skipping the gopath

This commit is contained in:
NotZippy
2018-10-02 08:00:38 -07:00
parent 9ad0065f6c
commit 43c188c1eb
3 changed files with 22 additions and 8 deletions

View File

@@ -12,7 +12,14 @@ func CmdInit(c *exec.Cmd, basePath string) {
c.Dir = basePath
// Go 1.8 fails if we do not include the GOROOT
c.Env = []string{"GOPATH=" + build.Default.GOPATH, "PATH=" + GetEnv("PATH"), "GOROOT="+ GetEnv("GOROOT")}
// Fetch the rest of the env variables
for _, e := range os.Environ() {
pair := strings.Split(e, "=")
if pair[0]=="GOPATH" {
continue
}
c.Env = append(c.Env,e)
}
}
// Returns an environment variable