How can I import the github version of Golang Appengine because the version google.golang.org/appengine is outdated?

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

How can I import the github version of Golang Appengine because the version google.golang.org/appengine is outdated?

问题

google.golang.org/appengine的存储库已过时(特别是aetest包),最新版本的aetest似乎在github.com/golang/appengine上。

我不确定如何正确地将存储库代码导入到我的本地计算机,因为代码存储库中的导入路径指向一个过时的存储库。

我尝试了:
$ go get github.com/golang/appengine

package github.com/golang/appengine: code in directory /Users/Bryan/work/gocode/src/github.com/golang/appengine expects import "google.golang.org/appengine"

所以看起来Github存储库中的代码使用了旧的导入路径。

我应该如何正确导入最新版本的golang appengine?

英文:

The repository at google.golang.org/appengine is outdated( aetest package specifically), the most current version of aetest looks like it's at github.com/golang/appengine

I'm not sure how to propery import the repository code to my local computer because the import paths in the code repository are to an outdated repository.

I attempted:
$ go get github.com/golang/appengine

package github.com/golang/appengine: code in directory /Users/Bryan/work/gocode/src/github.com/golang/appengine expects import "google.golang.org/appengine"

So it looks like the code in the Github repository uses the old import path.

How should I properly import the most current version of golang appengine?

答案1

得分: 1

将文件从$GOPATH/src/github.com/golang/appengine复制到$GOPATH/src/google.golang.org/appengine,并将google.golang.org/appengine作为导入路径使用。

或者进入$GOPATH/src/github.com/golang/appengine/doc.go,并删除文件中package appengine后面的注释。

这是Go 1.4中添加的规范导入路径的结果。

英文:

Copy the files from $GOPATH/src/github.com/golang/appengine to $GOPATH/src/google.golang.org/appengine, and use google.golang.org/appengine as the import path.

That, or go into $GOPATH/src/github.com/golang/appengine/doc.go and delete the comment after package appengine in the file.

This is a result of canonical import paths added in Go 1.4.

huangapple
  • 本文由 发表于 2017年5月2日 01:04:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/43723126.html
匿名

发表评论

匿名网友

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

确定