Cross compiling Go programs

When I want to build an application on my macOS that will be deployed on Plan 9 I run:

% GOOS=plan9 GOARCH=amd64 go build

Go compiler toolchain originates from the pretty neat Plan 9 toolchain that includes Plan 9 assembler and C compilers. All possible combinations of GOOS and GOARCH can be found from the Go environment variables documentation.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store