英文:
How to create a static Go binary which runs on every distro?
问题
你好!以下是你要翻译的内容:
如何创建一个在每个Linux发行版上运行的静态Go应用程序?
只需要像这样静态编译Go程序就足够了吗:http://blog.hashbangbash.com/2014/04/linking-golang-statically/
英文:
How can I create a static Go application that runs on every Linux distribution?
Is it enough just to compile Go statically as in: http://blog.hashbangbash.com/2014/04/linking-golang-statically/
答案1
得分: 8
只要你编译时设置了GOOS==linux,并且支持该架构(如amd64/x86等),并且所需的系统调用可用,它就可以在任何Linux发行版上运行。这通常由你的Linux内核版本确定。
英文:
It will work on every Linux distro if you've compiled for GOOS==linux as long as the architecture is supported (amd64/x86 etc.), and the required syscalls are available. This is usually determined by your Linux kernel version.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论