From dc73bc1f984fa0d1149b4ce7feca9cd3ca310c14 Mon Sep 17 00:00:00 2001 From: "Marcelo E. Magallon" Date: Sat, 10 Sep 2022 15:05:53 -0600 Subject: [PATCH] cmd/go: expand help text for go mod tidy `go mod tidy` will ignore files with the build constraint `ignore`. This is documented in https://go.dev/ref/mod#go-mod-tidy. While this URL in mentioned in the existing help text, the fact about the special handling of the `ignore` tag is significant enough to be mentioned explicitly in the help text. From the existing link it's not inmediately obvious that this special behavior exists. Take most of the relevant text from the online description and add it to the help text of `go mod tidy`. Fixes: #54993 Signed-off-by: Marcelo E. Magallon --- src/cmd/go/alldocs.go | 3 +++ src/cmd/go/internal/modcmd/tidy.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 4c72ab6d56..206e11e865 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1319,6 +1319,9 @@ // // The -x flag causes tidy to print the commands download executes. // +// Tidy treats all build constraints except 'ignore' as satisfied, including +// implicit constraints from filenames. +// // See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'. // // # Make vendored copy of dependencies diff --git a/src/cmd/go/internal/modcmd/tidy.go b/src/cmd/go/internal/modcmd/tidy.go index 7e33ad2ded..e62786c613 100644 --- a/src/cmd/go/internal/modcmd/tidy.go +++ b/src/cmd/go/internal/modcmd/tidy.go @@ -50,6 +50,9 @@ file. The -x flag causes tidy to print the commands download executes. +Tidy treats all build constraints except 'ignore' as satisfied, including +implicit constraints from filenames. + See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'. `, Run: runTidy,