Go CLI Cross Compile and Release/List target platforms

Print supported GOOS/GOARCH pairs.

Section: Cross Compilation

List target platforms

bash
bash
go tool dist list
Explanation

Print supported GOOS/GOARCH pairs. 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 Cross Compilation
Build Linux amd64
Cross-compile for Linux amd64.
OpenIn sheetbashsame section
Build macOS arm64
Cross-compile for macOS Apple Silicon.
OpenIn sheetbashsame section
Build Windows exe
Cross-compile a Windows executable.
OpenIn sheetbashsame section
Disable CGO
Build without CGO for simpler static-ish builds.
OpenIn sheetbashsame section
Trim source paths
Remove local filesystem paths from compiled output.
OpenIn sheetbash1 tag match
Test then build
A typical release pipeline pattern.
OpenIn sheetbash1 tag match