Skip to content

Commit

Permalink
Replace GOPATH in Environment
Browse files Browse the repository at this point in the history
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 <jmcatamney@pivotal.io>
  • Loading branch information
khuddlefish committed Oct 31, 2017
1 parent 11459a8 commit 4b883f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integration/watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b883f0

Please sign in to comment.