为什么Go程序需要运行时支持 [英] Why Go Programs need runtime support

查看:113
本文介绍了为什么Go程序需要运行时支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据说Golang是已编译的语言,但是编译的含义是什么?如果golang应用程序被编译为机器代码,为什么我不能仅仅分发二进制文件(当然在相应的arch和platform上)而不是 go install stuff?

解决方案

一旦你编译了一个二进制文件,你就可以将它分发到具有相同体系结构的机器上。 go install, go run,等仅仅是编译所必需的。

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?

解决方案

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.

这篇关于为什么Go程序需要运行时支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆