Skip to content

Commit b574590

Browse files
thepuddsgopherbot
authored andcommitted
cmd/go: document -modfile and other flags for 'go tool'
Mention -modfile, -C, -overlay, and -modcacherw in the 'go tool' documentation. We let a reference to 'go help build' give a pointer to more detailed information. The -modfile flag in particular is newly useful with the Go 1.24 support for user-defined tools with 'go tool'. Updates #48429 Updates #33926 Updates #71663 Fixes #71502 Change-Id: Ida67df50ff774a0886733d661a40e27c2cadc0f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/648577 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Conrad Irwin <[email protected]> Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Sam Thanawalla <[email protected]> Auto-Submit: Sam Thanawalla <[email protected]>
1 parent d9cc494 commit b574590

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/cmd/go/alldocs.go

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/tool/tool.go

+7
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ With no arguments it prints the list of known tools.
4646
The -n flag causes tool to print the command that would be
4747
executed but not execute it.
4848
49+
The -modfile=file.mod build flag causes tool to use an alternate file
50+
instead of the go.mod in the module root directory.
51+
52+
Tool also provides the -C, -overlay, and -modcacherw build flags.
53+
54+
For more about build flags, see 'go help build'.
55+
4956
For more about each builtin tool command, see 'go doc cmd/<command>'.
5057
`,
5158
}

0 commit comments

Comments
 (0)