Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: go mod download -json does not output json when sumdb fails #34485
For example, if you run
However, say you have a private repo you'd like to
Digging a little more, I see that most sumdb-checking functions just call
Here's what I had to do to fix it: marwan-at-work@f143bce
I'd be happy to submit the commit above as a CL if it looks okay as a fix
What version of Go are you using (
Does that mean that go proxies should always try to parse json from stdout (on failure and success) and if the parsing fails they need to read stderr as the alternate failure message?
That's kind of what I expected. "Any other such failure" does produce valid json, therefore I expected the sumdb failure to also behave similarly.
For example the following command fails, but produces valid json:
While the same exact command fails (for a different reason), but does not produce a valid json:
The issue is that some json data will be lost or may not even be the same shape, for example:
So I imagine base.Fatalf will probably have its own json shape that describes the error and potential extra information.
That sounds good but the issue is that at this moment, running
If the patch is to change all errors to use base.Fatalf shape, then that will be consistent, but I imagine that's an equally large change to the codebase.
But maybe you had something else in mind for how the go proxies should deal with
Thanks for the quick response!
I agree that proxies should be robust to missing JSON output.
On the other hand, I suspect that we will need to convert many calls to
So I'm not sure that