]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: test fixes dropped from CL 31821
authorRuss Cox <rsc@golang.org>
Sat, 29 Oct 2016 17:53:22 +0000 (13:53 -0400)
committerRuss Cox <rsc@golang.org>
Sat, 29 Oct 2016 18:36:48 +0000 (18:36 +0000)
Because git.

Change-Id: Ia1e7c6ba0e8c4d47f993487d2483cbb213b465e5
Reviewed-on: https://go-review.googlesource.com/32351
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/go_test.go

index c96acb74c92a034c30bc8452524747f3b57bb20b..86c8a80cefa2d2b2cf7ef7d182a7b097661669f7 100644 (file)
@@ -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
        `)