我是Go
的新手,如果我错了,请纠正我。由于Go
可执行文件是静态链接的。因此,如果我使用Linux (ubuntu)
,我可以在Windows中进行编码以及在部署时进行编码。那么,有可能这样做,或者我在这里遗漏了一些东西。
答案 0 :(得分:2)
It is possible, but a bit more complex than what you describe. Regardless of statically compiling, the Go compiler can generate code from any platform to any platform.
For a quick guide on how to do it, see this article http://dave.cheney.net/2015/03/03/cross-compilation-just-got-a-whole-lot-better-in-go-1-5