ianlancetaylor cmd/guru: if built with gccgo, switch to gc mode if GOROOT is valid
The gccgo compiler does not provide a gc-style GOROOT with standard
library sources. The effect is that guru may not fully work when using
gccgo. However, it can fully work if the GOROOT environment variable
points to valid gc-style GOROOT. In that case, make it work by telling
the go/build package to use gc mode.

Change-Id: Iadff8be61be8cc9a7ff2ca0a067b116b62895451
Reviewed-on: https://go-review.googlesource.com/117997
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Latest commit 2475cf1 Jun 12, 2018
Permalink
..
Failed to load latest commit information.
serial cmd/guru: support streaming plain and -json output Apr 11, 2016
testdata/src cmd/guru: emit initial referrers result earlier May 1, 2018
callees.go x/tools/cmd/guru: gofmt -s -w Feb 15, 2017
callers.go cmd/guru: add workaround to handle inconsistency between go/types and gc Nov 23, 2016
callstack.go cmd/guru: add workaround to handle inconsistency between go/types and gc Nov 23, 2016
definition.go cmd/guru: revert support for Go 1.8 aliases Nov 4, 2016
describe.go x/tools: support Go 1.9 type aliases Feb 13, 2017
freevars.go cmd/guru: support streaming plain and -json output Apr 11, 2016
guru.go cmd/guru: parallelize loop in globalReferrersPkgLevel May 1, 2018
guru_test.go cmd/guru: skip the slow tests in short mode May 4, 2018
implements.go x/tools: support Go 1.9 type aliases Feb 13, 2017
isAlias18.go x/tools: support Go 1.9 type aliases Feb 13, 2017
isAlias19.go x/tools: support Go 1.9 type aliases Feb 13, 2017
main.go cmd/guru: if built with gccgo, switch to gc mode if GOROOT is valid Jun 11, 2018
peers.go cmd/guru: add workaround to handle inconsistency between go/types and gc Nov 23, 2016
pointsto.go cmd/guru: add workaround to handle inconsistency between go/types and gc Nov 23, 2016
pos.go cmd/guru: fix typo of 'hyphen' to rename to 'comma' Jan 25, 2017
referrers.go cmd/guru: fix vet error in referrers.go May 2, 2018
unit_test.go go/buildutil, cmd/guru: resolve symlinks in filenames through build.C… Dec 6, 2016
what.go cmd/guru: report 'whicherrs' in modes of 'what' query Mar 4, 2017
whicherrs.go x/tools: support Go 1.9 type aliases Feb 13, 2017