aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/alldocs.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2021-05-14 16:53:06 -0400
committerBryan C. Mills <bcmills@google.com>2021-05-25 13:18:26 +0000
commit8b462d75670dcd8b6a08cf9af225eb8e7628d412 (patch)
tree8c27c58384d324a7c19d6a041a364693ac5cf4b1 /src/cmd/go/alldocs.go
parentc89f1224a544cde464fcb86e78ebb0cc97eedba2 (diff)
downloadgo-8b462d75670dcd8b6a08cf9af225eb8e7628d412.tar.gz
go-8b462d75670dcd8b6a08cf9af225eb8e7628d412.zip
cmd/go: add a -compat flag to 'go mod tidy'
Fixes #46141 Change-Id: I9d4032e75252ade9eaa937389ea97ef3fb287499 Reviewed-on: https://go-review.googlesource.com/c/go/+/321071 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/alldocs.go')
-rw-r--r--src/cmd/go/alldocs.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index fcc7f36335..bad2b7f16e 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -1221,7 +1221,7 @@
//
// Usage:
//
-// go mod tidy [-e] [-v] [-go=version]
+// go mod tidy [-e] [-v] [-go=version] [-compat=version]
//
// Tidy makes sure go.mod matches the source code in the module.
// It adds any missing modules necessary to build the current module's
@@ -1241,6 +1241,14 @@
// (Go versions 1.17 and higher retain more requirements in order to
// support lazy module loading.)
//
+// The -compat flag preserves any additional checksums needed for the
+// 'go' command from the indicated major Go release to successfully load
+// the module graph, and causes tidy to error out if that version of the
+// 'go' command would load any imported package from a different module
+// version. By default, tidy acts as if the -compat flag were set to the
+// version prior to the one indicated by the 'go' directive in the go.mod
+// file.
+//
// See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'.
//
//