]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: warn on get from code.google.com that it is shutting down
authorIan Lance Taylor <iant@golang.org>
Sat, 11 Jul 2015 13:42:48 +0000 (06:42 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 14 Jul 2015 18:18:12 +0000 (18:18 +0000)
Fixes #10193.

Change-Id: Ibbb747babb697a66b943e5da76b0ada41f1fb14f
Reviewed-on: https://go-review.googlesource.com/12070
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/get.go
src/cmd/go/go_test.go

index 48b94d726538c11bd808da74a24b29b0980af3c9..f4780e18aa1af4b928816bc12aaa7f303869a5b5 100644 (file)
@@ -205,6 +205,16 @@ func download(arg string, parent *Package, stk *importStack, getTestDeps bool) {
                        return
                }
 
+               // Warn that code.google.com is shutting down.  We
+               // issue the warning here because this is where we
+               // have the import stack.
+               if strings.HasPrefix(p.ImportPath, "code.google.com") {
+                       fmt.Fprintf(os.Stderr, "warning: code.google.com is shutting down; import path %v will stop working\n", p.ImportPath)
+                       if len(*stk) > 1 {
+                               fmt.Fprintf(os.Stderr, "warning: package %v\n", strings.Join(*stk, "\n\timports "))
+                       }
+               }
+
                args := []string{arg}
                // If the argument has a wildcard in it, re-evaluate the wildcard.
                // We delay this until after reloadPackage so that the old entry
index 3b0b112cb049b71976d1bde4d58fd07be3981fc2..008d40f7e11f1bcc7bb42b246cda05c46e602afb 100644 (file)
@@ -2019,3 +2019,15 @@ func TestGoGetInsecureCustomDomain(t *testing.T) {
        tg.runFail("get", "-d", repo)
        tg.run("get", "-d", "-insecure", repo)
 }
+
+func TestIssue10193(t *testing.T) {
+       testenv.MustHaveExternalNetwork(t)
+
+       tg := testgo(t)
+       defer tg.cleanup()
+       tg.parallel()
+       tg.tempDir("src")
+       tg.setenv("GOPATH", tg.path("."))
+       tg.runFail("get", "code.google.com/p/rsc-svn")
+       tg.grepStderr("is shutting down", "missed warning about code.google.com")
+}