From: Bryan C. Mills Date: Mon, 7 Jun 2021 21:04:32 +0000 (-0400) Subject: doc/go1.17: add a release note for the '-compat' flag to 'go mod tidy' X-Git-Tag: go1.17beta1~23 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0fb3e2c18408cc8ff6cb87962fc13f2684d1df96;p=gostls13.git doc/go1.17: add a release note for the '-compat' flag to 'go mod tidy' Updates #46141 Change-Id: I7a6a84f816e3db19bb492f862366a29dc46ed2ee Reviewed-on: https://go-review.googlesource.com/c/go/+/325910 Trust: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Go Bot Reviewed-by: Michael Matloob --- diff --git a/doc/go1.17.html b/doc/go1.17.html index c1978ff1c1..ba6b8baf19 100644 --- a/doc/go1.17.html +++ b/doc/go1.17.html @@ -137,8 +137,9 @@ Do not send CLs removing the interior tags from such phrases.

-

To facilitate the upgrade to lazy loading, - the go mod tidy subcommand now supports +

+ To facilitate the upgrade to lazy loading, the + go mod tidy subcommand now supports a -go flag to set or change the go version in the go.mod file. To enable lazy loading for an existing module without changing the selected versions of its dependencies, run: @@ -149,8 +150,32 @@ Do not send CLs removing the interior tags from such phrases.

- TODO: Describe the -compat flag - for go mod tidy. + By default, go mod tidy verifies that + the selected versions of dependencies relevant to the main module are the same + versions that would be used by the prior Go release (Go 1.16 for a module that + spsecifies go 1.17), and preserves + the go.sum entries needed by that release even for dependencies + that are not normally needed by other commands. +

+ +

+ The -compat flag allows that version to be overridden to support + older (or only newer) versions, up to the version specified by + the go directive in the go.mod file. To tidy + a go 1.17 module for Go 1.17 only, without saving + checksums for (or checking for consistency with) Go 1.16: +

+ +
+  go mod tidy -compat=1.17
+
+ +

+ Note that even if the main module is tidied with -compat=1.17, + users who require the module from a + go 1.16 or earlier module will still be able to + use it, provided that the packages use only compatible language and library + features.

Module deprecation comments