英文:
Proper GOPATH to include App Engine libraries from App Engine SDK?
问题
我正在尝试使用Go SDK为App Engine编写应用程序,但它似乎与单元测试有一种奇怪的关系。人们已经围绕这套原始且过时的工具编写了 库,但每次我尝试安装它们时,根据我使用的Go命令,我都会遇到以下两个问题之一:
- 从标准的
go
命令:找不到appengine
或appengine_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中的appengine
、appengine_internal
和goprotobuf
复制到您的本地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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论