]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add -retracted flag to 'go list'
authorJay Conrod <jayconrod@google.com>
Wed, 15 Apr 2020 18:42:15 +0000 (14:42 -0400)
committerJay Conrod <jayconrod@google.com>
Wed, 26 Aug 2020 21:17:01 +0000 (21:17 +0000)
commiteb3e27ac1a9346c7c2669ba2b863811607eddeae
tree767051299d2f74722b242fecca14c96751697da1
parent0bbd386e8bbdf419077d708d3671245fc0f50f0c
cmd/go: add -retracted flag to 'go list'

The -retracted flag causes 'go list' to load information about
retracted module module versions.

When -retracted is used with -f or -json, the Retracted field is set
to a string containing the reason for the retraction on retracted
module versions. The string is based on comments on the retract
directive. This field is also populated when the -u flag is used.

When -retracted is used with -versions, retracted versions are shown.
Normally, they are omitted.

For #24031

Change-Id: Ic13d516eddffb1b8404e21034f78cecc9896d1b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/228382
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
18 files changed:
src/cmd/go/alldocs.go
src/cmd/go/internal/list/list.go
src/cmd/go/internal/modcmd/download.go
src/cmd/go/internal/modcmd/why.go
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/list.go
src/cmd/go/testdata/mod/example.com_retract_missingmod_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_missingmod_v1.9.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_self_all_v1.9.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_self_prerelease_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_self_prerelease_v1.9.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_self_prerelease_v1.9.1-pre.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_self_pseudo_v0.0.0-20200325131415-0123456789ab [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_self_pseudo_v1.0.0-bad.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_retract_self_pseudo_v1.9.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_list_pseudo.txt
src/cmd/go/testdata/script/mod_list_retract.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_retract_replace.txt [new file with mode: 0644]