Skip to content

Commit 4b883f0

Browse files
committed
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 <[email protected]>
1 parent 11459a8 commit 4b883f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

integration/watch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var _ = Describe("Watch", func() {
4141

4242
startGinkgoWithGopath := func(args ...string) *gexec.Session {
4343
cmd := ginkgoCommand(rootPath, args...)
44-
cmd.Env = append([]string{"GOPATH=" + rootPath + ":" + os.Getenv("GOPATH")}, os.Environ()...)
44+
os.Setenv("GOPATH", rootPath+":"+os.Getenv("GOPATH"))
4545
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
4646
Ω(err).ShouldNot(HaveOccurred())
4747
return session

0 commit comments

Comments
 (0)