goinstall: error out with paths that end with '/'

R=adg, rsc, tarmigan+golang
CC=golang-dev
https://golang.org/cl/4807048
This commit is contained in:
Tarmigan Casebolt 2011-08-21 20:28:29 +10:00 committed by Andrew Gerrand
parent d1a3edaee7
commit f7b9ac765b
1 changed files with 6 additions and 0 deletions

View File

@ -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)