From 4b883f0bbff7d7fa65307e0e13dcf7b328131e08 Mon Sep 17 00:00:00 2001 From: Karen Huddleston Date: Mon, 30 Oct 2017 12:05:41 -0700 Subject: [PATCH] Replace GOPATH in Environment Previously the test GOPATH was being prepended to the existing OS environment, which means it would be overwritten if the user had GOPATH set. Now we replace the value of GOPATH with Setenv so it will take precedence over any existing value. Signed-off-by: Jamie McAtamney --- integration/watch_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/watch_test.go b/integration/watch_test.go index c18e8f871..8f3c0910f 100644 --- a/integration/watch_test.go +++ b/integration/watch_test.go @@ -41,7 +41,7 @@ var _ = Describe("Watch", func() { startGinkgoWithGopath := func(args ...string) *gexec.Session { cmd := ginkgoCommand(rootPath, args...) - cmd.Env = append([]string{"GOPATH=" + rootPath + ":" + os.Getenv("GOPATH")}, os.Environ()...) + os.Setenv("GOPATH", rootPath+":"+os.Getenv("GOPATH")) session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter) Ω(err).ShouldNot(HaveOccurred()) return session