我如何手动使用GO工具编译将多个软件包编译到一个可执行文件中
由于某些原因,我需要使用“ GO Tool Compile”来编译GO文件,而不是使用自动GO构建。 “ Go Tool Compile”在同一软件包中的一个文件或多个文件可以正常工作,但是如果我的项目结构是:
-package1
--p1.go
-package2
--p2.go
main.go
go.mod
with Main.Go使用Package1和poffage2中定义的符号。 那我应该如何使用:Go Tool编译“最终获得可执行程序?
For some reasons I need to use "go tool compile" to compile go files instead of using the automatic go build.
"go tool compile" works fine with one file or multiple files in the same package, but if my project structure is like:
-package1
--p1.go
-package2
--p2.go
main.go
go.mod
where main.go uses symbols defined in package1 and package2.
Then how am I supposed to use :go tool compile" to eventually get an executable program?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论