]> Cypherpunks repositories - gostls13.git/commitdiff
goinstall: warn when http:// is found at beginning of package name
authorScott Lawrence <bytbox@gmail.com>
Mon, 13 Sep 2010 02:59:59 +0000 (12:59 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 13 Sep 2010 02:59:59 +0000 (12:59 +1000)
Fixes #860.

R=golang-dev, adg1, rsc, adg
CC=golang-dev
https://golang.org/cl/2124046

src/cmd/goinstall/main.go

index 2d410cd4fcfb33e7cfd291388ad7d864907bda71..07ab622af0f3445f87a8b40c15a868f2c33bb010 100644 (file)
@@ -148,6 +148,11 @@ func install(pkg, parent string) {
        // If remote, download or update it.
        var dir string
        local := false
+       if strings.HasPrefix(pkg, "http://") {
+               fmt.Fprintf(os.Stderr, "%s: %s: 'http://' used in remote path, try '%s'\n", argv0, pkg, pkg[7:])
+               errors = true
+               return
+       }
        if isLocalPath(pkg) {
                dir = pkg
                local = true