1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:08:36 -06:00
go/cmd/heapview
Dmitri Shuralyov ef3dcd5937 cmd/heapview: look for tools repository in all GOPATH entries
The GOPATH environment variable is defined at
https://golang.org/cmd/go/#hdr-GOPATH_environment_variable as:

> The GOPATH environment variable lists places to look for Go code. On
> Unix, the value is a colon-separated string. On Windows, the value is
> a semicolon-separated string. On Plan 9, the value is a list.

It is legal for Go packages to be in any of those places, not only
the first entry. Look in all places for golang.org/x/tools repository.

Cache the directory that is found. It's slightly more expensive
to look for it, since potentially multiple directories must be
checked for existence.

Updates golang/go#19400.

Change-Id: I16661b7149d52ea6168fffc605c842d7a4da009b
Reviewed-on: https://go-review.googlesource.com/38778
Reviewed-by: Michael Matloob <matloob@golang.org>
2017-04-10 18:12:01 +00:00
..
client x/tools/cmd/heapview: add a sidebar to hold navigation 2016-08-16 17:33:40 +00:00
internal/core x/tools/cmd/heapview/internal/core: stub mmapfile for !darwin,!linux 2016-08-11 13:58:04 +00:00
main.go cmd/heapview: look for tools repository in all GOPATH entries 2017-04-10 18:12:01 +00:00