Get All Supported Platforms in Go

Get All Supported Platforms in Go

When working with the Go programming language, understanding which operating systems and architectures are supported by the toolchain is useful for cross-compilation and build planning. These combinations define where Go binaries can run and what targets can be produced during compilation. This tutorial demonstrates how to get the all supported platforms in Go.

The the go tool dist list command provides a simple way to display every supported operating system and architecture pair:

go tool dist list

Example output:

android/arm64
linux/amd64
linux/arm64
windows/amd64
windows/arm64

Each line represents a valid GOOS/GOARCH combination that the current Go distribution can build for. This information is commonly used when configuring CI pipelines, preparing multi-platform releases, or validating whether a target environment is supported by the installed toolchain.

Leave a Comment

Cancel reply

Your email address will not be published.