dongyu1614 2011-09-23 23:19
浏览 36
已采纳

如何为Google App Engine的GoClipse项目添加外部软件包?

I've compiled Goauth so that I can use OAuth in my Go Google App Engine project. Where do I put the goauth.a file so that I can both use it in the project, and have it available when deploying to the GAE servers? I can get it working locally if I put it in a subfolder of $GOROOT/pkg, but then it can't be found when compiling at deployment time.

GoClipse sets up a project with lots of folders, I'm not really sure what their purpose is, where should I put goauth.a and how do I import it?

  • 写回答

1条回答 默认 最新

  • dqenv99518 2011-09-26 08:14
    关注

    To fix this I ended up including the source for the package in the directory tree for my app, as mentioned in this thread on the google-appengine-go group http://groups.google.com/group/google-appengine-go/browse_thread/thread/1fe745debc678afb

    Here is the important part of the thread:

    You may include as many packages as necessary. Packages are imported by path relative to the base directory (the one that has your app.yaml file), so if you have the following:

    helloworld/app.yaml
    helloworld/hello/hello.go // package hello
    helloworld/world/world.go // package world

    you can import "world" in hello and import "hello" in world.

    If you are including a third-party library, it might look something like this:

    helloworld/app.yaml
    helloworld/hello/hello.go // package hello
    helloworld/world/world.go // package world
    helloworld/goprotobuf.googlecode.com/proto/*.go // package proto

    Then you can, as normal, import "goprotobuf.googlecode.com/proto".

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Pwm双极模式H桥驱动控制电机
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题