go-tool

Run Go toolchain programs

TLDR

List available tools
$ go tool
Run pprof
$ go tool pprof [profile.pb.gz]
Run trace
$ go tool trace [trace.out]
Run compile
$ go tool compile [file.go]
Run objdump
$ go tool objdump [binary]

SYNOPSIS

go tool [tool] [arguments]

DESCRIPTION

go tool runs Go toolchain programs that underlie the standard go commands. It provides access to low-level tools like the compiler, linker, profiler, and tracer.The command is used for advanced debugging, profiling, and understanding compiler behavior. Each tool has its own options and usage patterns.

PARAMETERS

TOOL

Tool name to run.
ARGUMENTS
Tool-specific arguments.
pprof
Profile viewer.
trace
Execution tracer.
compile
Go compiler.
link
Go linker.
objdump
Object file disassembler.
--help
Display help information.

INSTALL

sudo apt install gccgo-go
sudo dnf install gcc-go
sudo pacman -S gcc-go
sudo apk add gcc-go
sudo zypper install gcc-go
brew install go
nix profile install nixpkgs#go

CAVEATS

Low-level tools. May change between versions. For advanced users.

HISTORY

go tool provides access to Go toolchain internals, supporting debugging and optimization workflows.

SEE ALSO

go(1), go-build(1)

RESOURCES

Documentation