# ubuntu下交叉编译到windows-64位
$ sudo apt-get update
$ sudo apt-get install mingw-w64
$ CGO_ENABLED=1 CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build
# ubuntu下交叉编译到windows-64位
$ apt-get install gcc-mingw-w64
$ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc go build
# ubuntu下交叉编译到windows-32位
$ CGO_ENABLED=1 GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc go build
# 编译 32位的arm
$ sudo apt-get update
$ sudo apt-get install gcc-arm-linux-gnueabihf
$ CGO_ENABLED=1 GOOS=linux GOARCH=arm CC=arm-linux-gnueabihf-gcc go build
# 编译 64位的arm