Skip to content

Commit 206b1c4

Browse files
committed
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: golang#54993 Signed-off-by: Marcelo E. Magallon <[email protected]>
1 parent 336ce96 commit 206b1c4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cmd/go/internal/modcmd/tidy.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ version. By default, tidy acts as if the -compat flag were set to the
4848
version prior to the one indicated by the 'go' directive in the go.mod
4949
file.
5050
51+
Tidy treats all build constraints except 'ignore' as satisfied, including
52+
implicit constraints from filenames.
53+
5154
See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'.
5255
`,
5356
Run: runTidy,

0 commit comments

Comments
 (0)