在Run/Debug Configuration中添加环境变量配置:
CGO_ENABLED=0;GOOS=windows;GOARCH=amd64
注意不能用空格替代分号,不能写成CGO_ENABLED=0 GOOS=windows GOARCH=amd64
如下图:
Mac中使用Goland交叉编译成Windows可执行程序
最新推荐文章于 2024-05-17 10:04:41 发布
在Run/Debug Configuration中添加环境变量配置:
CGO_ENABLED=0;GOOS=windows;GOARCH=amd64
注意不能用空格替代分号,不能写成CGO_ENABLED=0 GOOS=windows GOARCH=amd64
如下图: