Compiling go binaries for different platforms
GOOS=linux GOARCH=amd64 go build main.go
To compile a go binary for alternate operating systems, for example using jenkins to compile a windows binary on a linux OS, you need to specify the OS and ARCH of the target platform.
How To Build Go Executables for Multiple Platforms on Ubuntu 16.04 | DigitalOcean
The Go programming language comes with a rich toolchain that makes obtaining packages and building executables incredibly easy. One of Go’s most powerful features is the ability to cross-build executables for any Go-supported foreign platform. This makes testing and package...

Member discussion