diff options
author | Russ Cox <rsc@golang.org> | 2015-07-14 15:24:26 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2015-07-15 05:06:50 +0000 |
commit | 238a39594b0237d0ca2be4b7ccf89c0e22a766d9 (patch) | |
tree | d95027a8b7510ab6639b5a7f2e9ccf339788ef22 | |
parent | 7126da2fd5c922ea2dd4ba3fe5578aa1e17ce510 (diff) | |
download | go-238a39594b0237d0ca2be4b7ccf89c0e22a766d9.tar.gz go-238a39594b0237d0ca2be4b7ccf89c0e22a766d9.zip |
cmd/go: add test for issue 3652
Fixes #3652. (Well, already fixed, but tests that it stays fixed.)
Change-Id: I4e17f595ee2ad513de86ac3861e8e66b1230b3be
Reviewed-on: https://go-review.googlesource.com/12195
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r-- | src/cmd/go/go_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index f3ab829729..8af8ab6cc3 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -2191,3 +2191,23 @@ func TestGoGetDomainRoot(t *testing.T) { tg.must(os.RemoveAll(tg.path("src/go-get-issue-9357.appspot.com"))) tg.run("get", "-u", "go-get-issue-9357.appspot.com") } + +func TestGoInstallShadowedGOPATH(t *testing.T) { + // golang.org/issue/3652. + // go get foo.io (not foo.io/subdir) was not working consistently. + + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path("gopath1")+string(filepath.ListSeparator)+tg.path("gopath2")) + + tg.tempDir("gopath1/src/test") + tg.tempDir("gopath2/src/test") + tg.tempFile("gopath2/src/test/main.go", "package main\nfunc main(){}\n") + + tg.cd(tg.path("gopath2/src/test")) + tg.runFail("install") + tg.grepStderr("no install location for.*gopath2.src.test: hidden by .*gopath1.src.test", "missing error") +} |