英文:
Why Go Programs need runtime support
问题
Golang被称为一种“编译型”语言,但是“编译型”是什么意思呢?如果Golang应用程序被编译成机器码,为什么我不能只分发二进制文件(当然是对应的架构和平台),而不是使用go install
这样的方式呢?
英文:
It's said that Golang is the compiled language, but what does it mean by compiled? If golang application is compiled to machine code, why can't I just distribute the binary (of course on corresponding arch and platform) instead of go install
stuff?
答案1
得分: 18
一旦你编译了一个二进制文件,你可以将它分发到具有相同架构的机器上。go install
、go run
等只是编译过程中必要的步骤。
英文:
Once you compile a binary you can distribute it onto machines with the same architecture. go install,
go run,
etc. is just necessary for compilation.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论