Golang 在 Mac、Linux、Windows 下交叉编译
文章目录
Mac 下编译 Linux 和 Windows 64位可执行程序
1 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go |
Linux 下编译 Mac 和 Windows 64位可执行程序
1 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go |
Windows 下编译 Mac 和 Linux 64位可执行程序
1 | SET CGO_ENABLED=0 |