diff --git a/go/packages/packages_test.go b/go/packages/packages_test.go index 7f6181c27fe..e2726561a9f 100644 --- a/go/packages/packages_test.go +++ b/go/packages/packages_test.go @@ -3363,7 +3363,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)