]> Cypherpunks repositories - gostls13.git/commit
cmd/go: consistent output for -json failures
authorMarwan Sulaiman <marwan.sameer@gmail.com>
Tue, 24 Sep 2019 20:34:16 +0000 (16:34 -0400)
committerJay Conrod <jayconrod@google.com>
Wed, 25 Sep 2019 20:48:49 +0000 (20:48 +0000)
commit6232dadc63dda3e6f8ce227ed7e003da80f5ba2e
tree09f168e0a714c533668ca5d81a044f1ff26bbe8a
parent262046716cf56637febf8dd6cbc27520e19d4db1
cmd/go: consistent output for -json failures

When the -json flag is passed to go mod download,
the sumdb error is embedded in the json Error field.
Other errors for the same command behave this way as
well such as module not found. The fix is done by changing
base.Fatalf into proper error returns.

Fixes #34485

Change-Id: I2727a5c70c7ab03988cad8661894d0f8ec71a768
Reviewed-on: https://go-review.googlesource.com/c/go/+/197062
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modfetch/cache.go
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/testdata/script/mod_download_json.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_sumdb.txt
src/cmd/go/testdata/script/mod_sumdb_file_path.txt