1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:04:46 -07:00
go/cmd/callgraph
Michael Matloob 0aa4b8830f go/packages: remove the Config.Error hook
Errors relating to a particular package (as opposed to the Load
operation as a whole) are now only recorded in the Errors
field of the corresponding Package.
Clients are responsible for printing or otherwise handling errors.
This is a breaking API change.

The PrintErrors function prints all accumulated errors,
dependencies first, and is provided for convenience.

PrintErrors is based on Visit, another helper function, which
visits each Package in an import graph.

Also:
- add an Example documenting typical use.
- update clients to handle errors explicitly.

Depends on https://go-review.googlesource.com/c/tools/+/130576

Change-Id: I39407ab7f46dae2f0dd0fdde21080e172e1258aa
Reviewed-on: https://go-review.googlesource.com/131015
Reviewed-by: Michael Matloob <matloob@golang.org>
2018-09-04 20:52:37 +00:00
..
testdata/src/pkg cmd/callgraph: use go/packages 2018-08-09 16:04:36 +00:00
main_test.go cmd/callgraph: temporarily disable failing tests on go1.10 2018-08-13 17:53:22 +00:00
main.go go/packages: remove the Config.Error hook 2018-09-04 20:52:37 +00:00