正确的GOPATH应该包括来自App Engine SDK的App Engine库吗?

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

Proper GOPATH to include App Engine libraries from App Engine SDK?

问题

我正在尝试使用Go SDK为App Engine编写应用程序,但它似乎与单元测试有一种奇怪的关系。人们已经围绕这套原始且过时的工具编写了 ,但每次我尝试安装它们时,根据我使用的Go命令,我都会遇到以下两个问题之一:

  • 从标准的go命令:找不到appengineappengine_internal
  • 从SDK的go命令:不允许构建包。我怀疑我不应该使用这个。

我猜想我必须调整我的$GOPATH,将SDK中的某个目录包含在其中,以便appengine包可见,但我已经尝试了许多变体(例如$SDK/goroot$SDK/goroot/src等),但它们似乎都不起作用。

  • 一般来说,有哪些测试策略可以建议用于Go的App Engine?

  • 具体来说,我该如何使这些包可见,以便我可以使用通用的Go工具来安装依赖于它们的库(如这些测试包)或运行自己的测试套件?

英文:

I'm trying to write an app for App Engine using the Go SDK, but it seems to have a funny relationship to unit testing. People have written libraries around this original, outdated set of tools, but every time I try to install them, depending on the Go command I use I run into one of two problems:

  • From the standard go: Can't locate 'appengine' or 'appengine_internal'
  • From the SDK's go: not allowed to build packages. I doubt I'm supposed to be using this.

My guess is that I have to manipulate my $GOPATH to include a directory somewhere in the SDK so that the appengine packages are visible, but I've tried many variations (such as $SDK/goroot, $SDK/goroot/src, etc.) and none of them seem to work.

-Generally-, what testing strategies might one suggest for App Engine for Go?

-Specifically-, how can I go about making those packages visible so that I may use the general Go tool to install libraries that depend on them (such as these testing packages) or otherwise run my own test suites?

答案1

得分: 2

这个答案提供了更新的gae-go-testing的详细安装说明。我快速浏览了一下,它们似乎是有效的。请注意,安装涉及将SDK中的appengineappengine_internalgoprotobuf复制到您的本地go安装目录中。

英文:

This answer provides detailed installation instructions for the updated gae-go-testing. I did a quick run through and they do seem to work. Note that installation involves copying across appengine, appengine_internal and goprotobuf from the SDK to your local go install.

huangapple
  • 本文由 发表于 2013年2月27日 06:19:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/15100490.html
匿名

发表评论

匿名网友

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

确定