GO-TOOL(1)
π GO-TOOL(1) β go-tool π
okay bestie, welcome to the go-tool page, from the Go programming tools and commands manual. this is literally the doorway to every tool that ships with Go, and i'm gonna walk you through it like we're texting at 2am. π¦
β¨ NAME β¨
go-tool β run specified go tool π
πΈ SYNOPSIS πΈ
---
# π DESCRIPTION π
So `tool` runs the go tool command that the arguments are pointing at. That's the whole vibe. π
Go comes with a bunch of <cyan>builtin tools</cyan> already, and you can also define extra tools inside the `go.mod` of the module you're currently in. Wanna add some? `go get -tool` is the move β it defines additional tools in the current module's `go.mod` file. For the full tea on that, go read `go help get`. π«Ά
You can name the command using the <hotpink>full package path</hotpink> to the tool that's declared with a `tool` directive. OR β and this is the cute shortcut β you can just use the tool's <lavender>default binary name</lavender>, which is the last component of the package path with the major version suffix left off. That shortcut only works if it's <yellow>unique</yellow> among the declared tools though. iykyk. π
And if you run it with <bold>no arguments at all</bold>? It just prints the list of known tools. A little menu, a little moment. β¨
---
# π
OPTIONS π
- **`-n`** β makes `tool` print the command that *would* be executed without actually executing it. no cap, it's just the receipts. π§Ύ
- **`-modfile=`*`file.mod`* β a build flag that makes `tool` use an alternate file instead of the `go.mod` sitting in the module root directory. π
- `tool` also gives you the **`-C`**, **`-overlay`**, and **`-modcacherw`** build flags. yes queen, all three. π
---
the go command puts `$GOROOT/bin` at the <green>beginning of `$PATH`</green> in the environment of commands run via `tool` directives, so that those commands use the same `go` as the parent `go tool`. matching energy, periodt. π
for more about build flags, see `go help build`.
for more about each builtin tool command, see `go doc cmd/<command>`.
> real talk bestie: the build flags are where the specifics live, so peek at `go help build` and `go doc cmd/<command>` rather than guessing. π
---
# π AUTHOR π
this manual page was created using <purple>help2man</purple> and afterwards updating the output. it's maintained by the <hotpink>Debian Go Compiler Team</hotpink> `<team+go-compiler@tracker.debian.org>` for the Debian project (and may be used by others). iconic of them honestly. π«Ά
---
okay that's the whole page, you ate that π½οΈβ¨ β this was <rainbow>Go 1.27</rainbow>, <lavender>August 2026</lavender>, and yeah the manual page is literally called `GO-TOOL(1)`. go forth and run some tools, main character. π
π¦ where this page comes from
- ubuntu stonking: golang-go 2:1.27~1 Β· Go
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms