1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:04:49 -07:00

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:
Brad Fitzpatrick 2017-06-13 22:34:38 +00:00
parent b4e0c5ecfb
commit f2cd9d3b51

View File

@ -171,7 +171,7 @@ func inGoPath() bool {
}
for _, path := range filepath.SplitList(os.Getenv("GOPATH")) {
if strings.HasPrefix(wd, path) {
if strings.HasPrefix(wd, filepath.Join(path, "src")) {
return true
}
}