GoLang / Google App Engine – 目录结构

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

GoLang / Google App Engine - Directory structure

问题

我开始用GoLang和GAE开发一个应用程序,但是我很难找到如何布局文件的方法。到目前为止,这是我保持GoLang文件组织的方式(在使用GAE之前)。

-golang
--bin
--pkg
--src
---breinbaas.nl
----lib
-----package1
-----package2

如果我想为GAE开发一个应用程序,我想把它放在

-golang
--src
---breinbaas
----deploy
-----mygae_app

但是我如何能够使用lib目录中的文件呢?

有没有办法使用golang/src/breinbaas/lib目录中的go文件?我一直得到一个找不到包的错误,我唯一能解决这个问题的方法是将lib目录复制到golang/src/breinbaas/deploy/mygae-app,但这意味着将源文件复制到多个位置,这对一致性来说非常糟糕。

提前感谢!
Rob

英文:

I started developing an app with GoLang & GAE but I am having a hard time finding out how to layout the files. This is how I keep my GoLang files organized so far (before using GAE)

-golang
--bin
--pkg
--src
---breinbaas.nl
----lib
-----package1
-----package2

If I want to develop an app for GAE I would like to put it into

-golang
--src
---breinbaas
----deploy
-----mygae_app

But how am I able to use the files in the lib directory?

Is there a way to use the go files in the golang/src/breinbaas/lib directory? I keep getting a package not found error and the only way I can resolve this is by copying the lib directory to golang/src/breinbaas/deploy/mygae-app but that would mean copying source files to more than one location which is very bad for consistency.

Thx in advance!
Rob

答案1

得分: 2

The Go App Engine SDK doesn't currently support uploading packages from your GOPATH, so for now copying is your only option.

Feel free to create an issue about this on the Google App Engine issue tracker.

英文:

The Go App Engine SDK doesn't currently support uploading packages from your GOPATH, so for now copying is your only option.

Feel free to create an issue about this on the Google App Engine issue tracker.

huangapple
  • 本文由 发表于 2012年10月10日 20:54:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/12819859.html
匿名

发表评论

匿名网友

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

确定