Using the go build command, we can actually build binaries for different target operating systems, a technique known as cross compiling. For example, on my macOS machine, I can build a 64-bit Linux binary that we can push out to the standalone production server running Ubuntu Linux. Prior to building our binary, we specify the target operating system we want to build to by setting the GOOS environment variable:
$ export GOOS=linux
By setting the GOOS environment variable to linux, we have specified that we wish to generate a binary file for Linux.
In order to specify that we want the binary to be a 64-bit binary, we set the GOARCH environment variable to specify the target architecture:
$ export GOARCH=amd64
By setting ...