How do you compile Go program on Windows for MacOS

huangapple go评论70阅读模式
英文:

How do you compile Go program on Windows for MacOS

问题

我找到的所有示例都假设你正在使用Mac,并为其他平台进行编译。

英文:

All the examples I've found so far assume you are using a Mac and compile for the other platforms.

答案1

得分: 2

根据你所说,你可以设置GOOS和GOARCH。

你可以使用以下go命令来检查所有的发行版:

go tool dist list

如何为MacOS构建应用程序:

GOOS=darwin GOARCH=amd64 go build main.go
英文:

As stated you can set the GOOS and GOARCH.

you can check all the distro using the following go command

go tool dist list

How to build the application for MacOS

GOOS=darwin GOARCH=amd64 go build main.go

huangapple
  • 本文由 发表于 2021年9月28日 12:13:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/69355731.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定