aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmd/goinstall/main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/goinstall/main.go b/src/cmd/goinstall/main.go
index 910ab7090a..baea260e56 100644
--- a/src/cmd/goinstall/main.go
+++ b/src/cmd/goinstall/main.go
@@ -182,6 +182,12 @@ func install(pkg, parent string) {
visit[pkg] = done
}()
+ // Don't allow trailing '/'
+ if _, f := filepath.Split(pkg); f == "" {
+ errorf("%s should not have trailing '/'\n", pkg)
+ return
+ }
+
// Check whether package is local or remote.
// If remote, download or update it.
tree, pkg, err := build.FindTree(pkg)