1
0
mirror of https://github.com/golang/go synced 2024-11-11 23:40:22 -07:00

goinstall: don't wrongly error out with "multiple package names"

Fixes #1215.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/2695042
This commit is contained in:
Fazlul Shahriar 2010-10-25 13:13:00 +11:00 committed by Andrew Gerrand
parent 4228e62259
commit ee065332dd

View File

@ -56,7 +56,7 @@ func goFiles(dir string, allowMain bool) (files []string, imports map[string]str
// do we return pkgName=="main".
// A mix of main and another package reverts
// to the original (allowMain=false) behaviour.
if allowMain && pkgName == "main" {
if s == "main" || pkgName == "main" {
return goFiles(dir, false)
}
return nil, nil, "", os.ErrorString("multiple package names in " + dir)