Building Go binaries for different platforms
One nice thing about Go is that it can cross-compile which allows me to use my Mac to build binaries for different operating systems. This is increibly useful for providing binaries for Rodeo, my command line Flickr uploader. To do this we set the GOOS and GOARCH environment variables before calling go build. For example to build for x64 on Linux, I do: version=`git describe –tags HEAD` env GOOS=linux GOARCH=amd64 go build \ -ldflags "-X… continue reading.