From: Dave Cheney Date: Mon, 7 Jan 2013 23:00:21 +0000 (+1100) Subject: cmd/go: use filepath.SplitList when inspecting GOPATH X-Git-Tag: go1.1rc2~1455 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=77c343328ece54d140af2ed5514d68bb91b29734;p=gostls13.git cmd/go: use filepath.SplitList when inspecting GOPATH There exists a test case for this condition, but it only runs on unix systems, which neatly dovetails into the code always using ':' as the list separator. R=adg, iant CC=golang-dev https://golang.org/cl/7057052 --- diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index d66be9a272..7e34fdfd3a 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -128,7 +128,7 @@ func main() { if gopath := os.Getenv("GOPATH"); gopath == runtime.GOROOT() { fmt.Fprintf(os.Stderr, "warning: GOPATH set to GOROOT (%s) has no effect\n", gopath) } else { - for _, p := range strings.Split(gopath, ":") { + for _, p := range filepath.SplitList(gopath) { if build.IsLocalImport(p) { fmt.Fprintf(os.Stderr, "go: GOPATH entry is relative; must be absolute path: %q.\nRun 'go help gopath' for usage.\n", p) os.Exit(2)