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

cmd/go: treat all commands in exp/ as tools

Nothing in exp should get installed directly in bin,
at least not by default.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6497138
This commit is contained in:
Russ Cox 2012-09-14 12:06:21 -04:00
parent a4d08ed5df
commit ca75fdf972

View File

@ -269,8 +269,6 @@ var isGoTool = map[string]bool{
"cmd/fix": true,
"cmd/vet": true,
"cmd/yacc": true,
"exp/gotype": true,
"exp/ebnflint": true,
}
// expandScanner expands a scanner.List error into all the errors in the list.
@ -321,7 +319,7 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package
elem = full
}
p.target = filepath.Join(p.build.BinDir, elem)
if p.Goroot && isGoTool[p.ImportPath] {
if p.Goroot && (isGoTool[p.ImportPath] || hasPrefix(p.ImportPath, "exp/")) {
p.target = filepath.Join(gorootPkg, "tool", full)
}
if buildContext.GOOS == "windows" {