英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论