Go CLI Cheat Sheet/Install versioned tool

Install a tool at an explicit module version.

Section: Run Build Install

Install versioned tool

bash
bash
go install golang.org/x/tools/cmd/stringer@latest
Explanation

Install a tool at an explicit module version. Useful in Go CLI workflows.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Run Build Install
Install package
Compile and install a package binary.
OpenIn sheetbashsame section
Run program
Compile and run the current module entrypoint.
OpenIn sheetbashsame section
Run single file
Compile and run a single Go source file.
OpenIn sheetbashsame section
Build current package
Compile the current package or module target.
OpenIn sheetbashsame section
Build named binary
Write the compiled binary to a specific path.
OpenIn sheetbashsame section
Print Go version
Show the selected Go toolchain version.
OpenIn sheetbash1 tag match