1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:54:40 -07:00
go/cmd/callgraph
Alan Donovan aa46a01996 go/ssa/ssautil: add AllPackages method
In go1.10, go/packages falls back to loading all packages
from source but not typechecking function bodies for imports.
The ssautil.Packages function would nonetheless provide
the partially-typed ASTs to the SSA builder, which would crash.
Now Packages only passes syntax trees to the SSA builder for
the initial packages, which are the only ones guaranteed to be
fully typed.

It is impossible to discern whether the caller of Packages intends to
build SSA code for dependencies, as in some clients such as
cmd/callgraph, so we add a new function, AllPackages, that expresses
this intent.

Fixes golang/go#28106

Change-Id: I6a88b7c7545e9de90b61f5bee0e6de3d2e21b548
Reviewed-on: https://go-review.googlesource.com/c/141686
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-10-15 18:41:29 +00:00
..
testdata/src/pkg cmd/callgraph: use go/packages 2018-08-09 16:04:36 +00:00
main_test.go all: set GO111MODULE=off for tests that use GOPATHs in testdata. 2018-10-03 17:21:27 +00:00
main.go go/ssa/ssautil: add AllPackages method 2018-10-15 18:41:29 +00:00