无法找到导入: “code.google.com/p/goauth2/oauth”

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

can't find import: "code.google.com/p/goauth2/oauth"

问题

我正在使用Google Glass Go的Goggle App Engine快速入门。在启动应用程序时遇到了以下问题:

> 找不到导入: "code.google.com/p/goauth2/oauth"

我已经设置了正确的GOPATH,并使用以下命令获取了outauth包:

> go get code.google.com/p/goauth2/oauth

我确认该包在GOPATH中可用。我运行了其他各种Go App Engine应用程序而没有任何问题。有人遇到过相同的问题吗?

> go version
go version go1.1.1 (appengine-1.8.2) darwin/amd64

> go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="<EXISTING_PATH>/gopath"
GORACE=""
GOROOT="<EXISTING_PATH>/goroot"
GOTOOLDIR="<EXISTING_PATH>/darwin_amd64"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-common"
CGO_ENABLED="1"
英文:

I am using the Google Glass Go quickstart for Goggle App Engine. And got stuck at this issues when starting the app:

> can't find import: "code.google.com/p/goauth2/oauth"

I have a propper GOPATH and did get the outauth package with

> go get code.google.com/p/goauth2/oauth

I confirmed that the package is available at GOPATH. I ran various other Go App Engine apps without problems. Has anyone seen the same issue?

> go version
go version go1.1.1 (appengine-1.8.2) darwin/amd64

> go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="<EXISTING_PATH>/gopath"
GORACE=""
GOROOT="<EXISTING_PATH>/goroot"
GOTOOLDIR="<EXISTING_PATH>/darwin_amd64"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-common"
CGO_ENABLED="1"

答案1

得分: 1

AppEngine for Go目前使用自己的Go版本,并设置了自定义的GOPATH。您需要将源代码放在yourapp/目录中的某个位置(最好与包的名称相同,例如code.google.com/p/goauth2/oauth/),以便a)在部署期间将文件传输到服务器,并且b)以便您的本地GAE环境可以找到它们。

我认为Go GAE团队已经在努力消除这些限制,但他们还没有宣布任何消息。

英文:

AppEngine for Go currently uses its own version of Go and also sets up a custom GOPATH. You need to put the sources somewhere in your yourapp/ directory (preferable under the very same name of the package, e.g. code.google.com/p/goauth2/oauth/ so that a) the files get transmitted to the server during deployment and b) so that you local GAE environment can find them.

I think the Go GAE team is already working to remove those restrictions, but they haven't announced anything yet.

huangapple
  • 本文由 发表于 2013年8月2日 11:04:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/18008089.html
匿名

发表评论

匿名网友

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

确定