Update GoTool for new tool support and better parsing.
Review Request #11570 — Created April 2, 2021 and submitted
GoToolto subclass the newer
BaseTool, and to use the
newer features it offers (dependencies, improved file extension
handling, new mixin for full-repository support).
It also fixes a number of issues that could arise with parsing the
output from both
go vet. The original implementation
requested JSON payloads from both, but
go vet's JSON payloads are not
guaranteed. Parser/compiler errors would result in standard errors, not
JSON payloads, causing our parsing to break.
The new implementation just parses the standard error output,
simplifying the code considerably. That will catch both forms of results
go testparsing has been improved as well. We no longer make
assumptions that all lines of code can be joined into a single JSON
array, instead parsing each line individually. We combine results
indicating failed test runs along with results showing test output into
a single representation, and build comments from that (helping
developers see why tests failed). We also provide general comments if
we fail to find any useful results but do find errors, showing the
output that occurred.
Unit tests pass on Python 2.7 and 3.x.
E501 line too long (80 > 79 characters)