cmd/go-contrib-init: fix in-GOPATH check
It's okay to have GOROOT=$HOME/go, GOPATH=$HOME. That's what I have. It's just not okay to hack in Go under $GOPATH/src. Change-Id: I6ae69aceb43970bbdc9631ab090689a153954087 Reviewed-on: https://go-review.googlesource.com/45651 Reviewed-by: Steve Francia <spf@golang.org>
This commit is contained in:
parent
b4e0c5ecfb
commit
f2cd9d3b51
|
@ -171,7 +171,7 @@ func inGoPath() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, path := range filepath.SplitList(os.Getenv("GOPATH")) {
|
for _, path := range filepath.SplitList(os.Getenv("GOPATH")) {
|
||||||
if strings.HasPrefix(wd, path) {
|
if strings.HasPrefix(wd, filepath.Join(path, "src")) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue