From f2cd9d3b518cfa0e287637dd02a895ce2b587f14 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 13 Jun 2017 22:34:38 +0000 Subject: [PATCH] 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 --- cmd/go-contrib-init/contrib.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/go-contrib-init/contrib.go b/cmd/go-contrib-init/contrib.go index b7a07a015d..edb27d5712 100644 --- a/cmd/go-contrib-init/contrib.go +++ b/cmd/go-contrib-init/contrib.go @@ -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 } }