Go, Google Cloud Appengine 本地包

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

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

huangapple
  • 本文由 发表于 2014年11月10日 13:35:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/26837397.html
匿名

发表评论

匿名网友

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

确定