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 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题