July 3, 2021 | 11:38
go tool dist list
Imagine that you want to cross-compile your Go binary from your Mac for a Linux machine that runs on arm64 architecture. With Go, it’s a matter of specifying the GOOS and GOARCH environment variables for go build command.
GOOS=linux GOARCH=arm64 go build main.go You don’t always know/remember what values for GOOS and GOARCH or you are not even sure if Go supports the target you desire. This is where the command go tool dist list comes in handy, when you run it it will list all the GOOS/GOARCH combinations available for the Go version that you are running.
Read more