Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我在 go 中开发了 2 个应用程序,并且我希望它们每个都有一个副本它们的依赖项(并且不是所有依赖项都在一个中心位置),并且每个应用程序都将由 ubuntu 中的新贵运行,我如何为每个应用程序?
您可以编写 shellscript 来启动您的 go 应用程序并在那里设置所需的环境。新贵作业然后调用 shellscript 而不是应用程序本身。
正如多米尼克在评论中所说。GOPATH编译 go 二进制文件后,您无需设置。GOPATH 仅在构建阶段有效。
GOPATH