From 5552d08b14b6a5099147934111a34f8362341ae2 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 29 Oct 2016 13:53:22 -0400 Subject: [PATCH] cmd/go: test fixes dropped from CL 31821 Because git. Change-Id: Ia1e7c6ba0e8c4d47f993487d2483cbb213b465e5 Reviewed-on: https://go-review.googlesource.com/32351 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/go/go_test.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index c96acb74c9..86c8a80cef 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -99,6 +99,7 @@ func TestMain(m *testing.M) { // Don't let these environment variables confuse the test. os.Unsetenv("GOBIN") os.Unsetenv("GOPATH") + os.Setenv("HOME", "/test-go-home-does-not-exist") r := m.Run() @@ -135,15 +136,7 @@ func testgo(t *testing.T) *testgoData { t.Skip("skipping external tests on %s/%s", runtime.GOOS, runtime.GOARCH) } - tg := &testgoData{t: t} - - // Hide user's local .gitconfig from git invocations. - // In particular, people using Github 2FA may configure - // https://github.com/ to redirect to ssh://git@github.com/ - // using an insteadOf configuration, and that will break various - // of our tests. - tg.setenv("HOME", "/test-go-home-does-not-exist") - return tg + return &testgoData{t: t} } // must gives a fatal error if err is not nil. @@ -2569,7 +2562,6 @@ func TestImportLocal(t *testing.T) { tg := testgo(t) defer tg.cleanup() - // Importing package main from that package main's test should work. tg.tempFile("src/dir/x/x.go", `package x var X int `) -- 2.48.1