“compile”和“build”在Go语言中有什么区别?

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

What is the difference between "compile" and "build" in Go?

问题

“compile”和“build”在Golang中的准确区别是什么?

英文:

What is the accurate difference between "compile" and "build" in Golang?

答案1

得分: 3

go命令在内部调用一个名为compile的内部工具,该工具从源代码文件生成所谓的“目标文件”。然后,它调用名为link的内部工具,该工具接受这些目标代码文件并生成最终的可执行映像文件或包,具体取决于正在构建的内容。

我认为你应该从这里开始,然后是这里,然后运行go build命令,并传递-x命令行参数,使其详细打印出它所做的操作。

英文:

The go command internally calls an internal tool called compile which produces so-called "object files" from the source code files. It then calls the internal tool called link which takes those object code files and produces a final executable image file or a package—depending on what is being built.

I think you should start with this, then this and then run the go build command passing it the -x command-line parameter, making it verbosely print what is does.

huangapple
  • 本文由 发表于 2021年10月6日 20:12:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/69465514.html
匿名

发表评论

匿名网友

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

确定