aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-07-14 15:15:37 -0400
committerRuss Cox <rsc@golang.org>2015-07-15 04:30:13 +0000
commit9adf684686bad7c6319080d0b1da8308a77b08c9 (patch)
treeded1e63fd88378a76c32e1808da8e4423decfd8d
parent4325a9ee2ae57e395779b96f3bd55d21e01eee88 (diff)
downloadgo-9adf684686bad7c6319080d0b1da8308a77b08c9.tar.gz
go-9adf684686bad7c6319080d0b1da8308a77b08c9.zip
cmd/go: fix TestVendorRun when $GOROOT is inside a symlinked path
Fixes #11305. Change-Id: Icaa3a009aa4ab214c9aaf74f52c3e622fa266a9d Reviewed-on: https://go-review.googlesource.com/12194 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/cmd/go/go_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go
index 98486c5294..af5439616f 100644
--- a/src/cmd/go/go_test.go
+++ b/src/cmd/go/go_test.go
@@ -188,7 +188,11 @@ func (tg *testgoData) cd(dir string) {
if tg.wd == "" {
tg.wd = tg.pwd()
}
+ abs, err := filepath.Abs(dir)
tg.must(os.Chdir(dir))
+ if err == nil {
+ tg.setenv("PWD", abs)
+ }
}
// sleep sleeps for one tick, where a tick is a conservative estimate