diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 98486c5294e..af5439616f6 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