Golang supports cross-compilation for generating executable programs on one platform for another platform.
Compile 64-bit executables for Linux, Windows platforms under Mac.
Compiling 64-bit executable programs for Mac, Windows platforms under Linux.
Compiling 64-bit executable programs for Mac, Linux platforms under Windows.
GOOS: target executable running operating system, supports darwin, freebsd, linux, windows.
GOARCH: target executable operating system architecture, including 386, amd64, arm.
Before Golang 1.5, you need to configure the cross-compilation environment when you cross-compile for the first time.