diff --git a/go/packages/packages_test.go b/go/packages/packages_test.go index 1f2c681c481..fc420321c31 100644 --- a/go/packages/packages_test.go +++ b/go/packages/packages_test.go @@ -3339,7 +3339,7 @@ func main() { pkgs, err := packages.Load(&packages.Config{ Mode: packages.NeedName | packages.NeedTarget, - Env: []string{"GOPATH=" + gopath, "GO111MODULE=off"}, + Env: append(os.Environ(), "GOPATH=" + gopath, "GO111MODULE=off"), }, filepath.Join(gopath, "src", "...")) if err != nil { t.Fatal(err)