diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 37da67c8b7..e6eec09082 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.Unsetenv("GIT_ALLOW_PROTOCOL") if home, ccacheDir := os.Getenv("HOME"), os.Getenv("CCACHE_DIR"); home != "" && ccacheDir == "" { // On some systems the default C compiler is ccache. // Setting HOME to a non-existent directory will break diff --git a/src/cmd/go/vcs_test.go b/src/cmd/go/vcs_test.go index 798f6683a6..c73f5d0e85 100644 --- a/src/cmd/go/vcs_test.go +++ b/src/cmd/go/vcs_test.go @@ -271,6 +271,7 @@ func TestIsSecureGitAllowProtocol(t *testing.T) { {vcsBzr, "foo://example.com/bar.bzr", false}, } + defer os.Unsetenv("GIT_ALLOW_PROTOCOL") os.Setenv("GIT_ALLOW_PROTOCOL", "https:foo") for _, test := range tests { secure := test.vcs.isSecure(test.url)