]> Cypherpunks repositories - gostls13.git/commit
cmd/go: support -json flag in go version
authorxieyuschen <xieyuschen@gmail.com>
Mon, 14 Oct 2024 11:11:53 +0000 (19:11 +0800)
committerSam Thanawalla <samthanawalla@google.com>
Tue, 13 May 2025 16:21:20 +0000 (09:21 -0700)
commita632009c4a0b0826871baae7e7ce7804b4089d93
tree4b2a1513bc5236c81f969cf940d9162bb8a98c81
parent698f86139bf72bcf7cbf08accc1c34394cb57acb
cmd/go: support -json flag in go version

It supports features described in the issue:

* add -json flag for 'go version -m' to print json encoding of
  runtime/debug.BuildSetting to standard output.
* report an error when specifying -json flag without -m.
* print build settings on seperated line for each binary

Fixes #69712

Change-Id: I79cba2109f80f7459252d197a74959694c4eea1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/619955
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/version/version.go
src/cmd/go/testdata/script/version.txt
src/runtime/debug/mod.go