]> Cypherpunks repositories - gostls13.git/commit
cmd/go: support module deprecation
authorJay Conrod <jayconrod@google.com>
Wed, 31 Mar 2021 18:47:59 +0000 (14:47 -0400)
committerJay Conrod <jayconrod@google.com>
Fri, 9 Apr 2021 18:20:48 +0000 (18:20 +0000)
commit814c5ff13810e800aeb67fd0371e21984d4d2c64
treeb11301ba1ae9dacbae011f3e0e1d2fb024025ded
parent952187af12485eb665ae122f6d0bdb36e4a11ed7
cmd/go: support module deprecation

A module is deprecated if its author adds a comment containing a
paragraph starting with "Deprecated:" to its go.mod file. The comment
must appear immediately before the "module" directive or as a suffix
on the same line. The deprecation message runs from just after
"Deprecated:" to the end of the paragraph. This is implemented in
CL 301089.

'go list -m -u' loads deprecation messages from the latest version of
each module, not considering retractions (i.e., deprecations and
retractions are loaded from the same version). By default, deprecated
modules are printed with a "(deprecated)" suffix. The full deprecation
message is available in the -f and -json output.

'go get' prints deprecation warnings for modules named on the command
line. It also prints warnings for modules needed to build packages
named on the command line if those modules are direct dependencies of
the main module.

For #40357

Change-Id: Id81fb2b24710681b025becd6cd74f746f4378e78
Reviewed-on: https://go-review.googlesource.com/c/go/+/306334
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
20 files changed:
src/cmd/go/alldocs.go
src/cmd/go/internal/list/list.go
src/cmd/go/internal/modcmd/edit.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modinfo/info.go
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/list.go
src/cmd/go/internal/modload/modfile.go
src/cmd/go/testdata/mod/example.com_deprecated_a_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_deprecated_a_v1.9.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_deprecated_b_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_deprecated_b_v1.9.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_undeprecated_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_undeprecated_v1.0.1.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_deprecate_message.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_edit.txt
src/cmd/go/testdata/script/mod_get_deprecated.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_list_deprecated.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_list_deprecated_replace.txt [new file with mode: 0644]