英文:
Go, Google Cloud Appengine local package
问题
我有一个在Google Cloud项目中的包。我如何在Google Cloud中导入我的包?
foo // 我的包
main.go
然后在 main.go 中
我如何知道在Google Cloud控制台中我的 gopath 是什么?
你如何从 main.go 导入 foo 包?
我可以在 main.go 中只写 import "foo" 吗?
英文:
I have a package in Google Cloud project. How do I import my package in GOogle cloud?
foo // my package
main.go
Then in main.go
How do I know what gopath I have in Google cloud console?
How would you import foo package from main.go?
Can I just do import "foo" in main.go?
答案1
得分: 0
当您部署应用程序时,goapp工具将从您的本地GOPATH捆绑所有依赖项。如果应用程序在本地GOPATH上使用goapp serve运行,它应该可以在appengine上运行而无需额外的工作。有关更多信息,请参阅此处:https://blog.golang.org/the-app-engine-sdk-and-workspaces-gopath
英文:
When you deploy your application, the goapp tool will bundle all the dependencies from your local GOPATH. If the app runs with your local GOPATH with goapp serve, it should run on appengine without additional work. See here for more information: https://blog.golang.org/the-app-engine-sdk-and-workspaces-gopath
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论