Go语言项目在Linux系统build可以在Windows运行的包
- Windows
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o xxx.exe xxxx.go
- Mac
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o xxxx xxxx.go
其他
Mac CGO_ENABLED=0 GOOS=darwin GOARCH=amd64
Linux CGO_ENABLED=0 GOOS=linux GOARCH=amd64
Windows CGO_ENABLED=0 GOOS=windows GOARCH=amd64