summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Ziak <0xe2.0x9a.0x9b@gmail.com>2014-04-14 22:01:27 +0200
committerJan Ziak <0xe2.0x9a.0x9b@gmail.com>2014-04-14 22:01:27 +0200
commit72eba652ed9d276dea282990bcab23628a250feb (patch)
tree2db54b43acc080befd9894776aa51014de31a27a
parent1878e448af75e0b84a76c8060f428f7ea717b551 (diff)
downloadgo-72eba652ed9d276dea282990bcab23628a250feb.tar.gz
cmd/go: do not miss an error if import path contains "cmd/something"
Fixes issue 7638 LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/87300043
-rw-r--r--src/cmd/go/get.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/go/get.go b/src/cmd/go/get.go
index e61da7e2a..fb9a4ae23 100644
--- a/src/cmd/go/get.go
+++ b/src/cmd/go/get.go
@@ -143,6 +143,10 @@ var downloadRootCache = map[string]bool{}
// for the package named by the argument.
func download(arg string, stk *importStack, getTestDeps bool) {
p := loadPackage(arg, stk)
+ if p.Error != nil {
+ errorf("%s", p.Error)
+ return
+ }
// There's nothing to do if this is a package in the standard library.
if p.Standard {