无法找到导入项:”google.golang.org/cloud/storage”

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

can't find import: "google.golang.org/cloud/storage"

问题

我想使用云 API gcloud-golang 进行工作,所以我在 src 文件夹 中运行了 go get 命令:

goapp get google.golang.org/cloud

我可以在 LiteIDE 中“看到”该库,但是我无法运行 goapp serve 命令。

我得到了以下异常信息:

/home/mik/go-programs/src/google.golang.org/cloud/storage/acl.go:21: 找不到导入包: "google.golang.org/api/storage/v1"

2015/03/14 23:13:37 在 $GOPATH 中找不到包 "google.golang.org/api/googleapi":无法在以下任何位置找到包 "google.golang.org/api/googleapi":
	/home/mik/go_appengine/goroot/src/google.golang.org/api/googleapi(来自 $GOROOT)
	/home/mik/go-programs/src/google.golang.org/api/googleapi(来自 $GOPATH)
	/home/mik/goroot/pkg/src/google.golang.org/api/googleapi
	/home/mik/go_appengine/src/google.golang.org/api/googleapi
2015/03/14 23:13:37 在 $GOPATH 中找不到包 "google.golang.org/api/storage/v1":无法在以下任何位置找到包 "google.golang.org/api/storage/v1":
	/home/mik/go_appengine/goroot/src/google.golang.org/api/storage/v1(来自 $GOROOT)
	/home/mik/go-programs/src/google.golang.org/api/storage/v1(来自 $GOPATH)
	/home/mik/goroot/pkg/src/google.golang.org/api/storage/v1
	/home/mik/go_appengine/src/google.golang.org/api/storage/v1
2015/03/14 23:13:37 go-app-builder: 构建时间:5×6g(总共 223ms),0×gopack(总共 0),0×6l(总共 0)
2015/03/14 23:13:37 go-app-builder: 运行 6g 失败:退出状态 1
英文:

I want to work with the cloud api gcloud-golang so i did go get in the src folder

goapp get google.golang.org/cloud

I can "see" the library in th liteIDE but i cant goapp serve

Im getting this exception

/home/mik/go-programs/src/google.golang.org/cloud/storage/acl.go:21: can't find import: "google.golang.org/api/storage/v1"

2015/03/14 23:13:37 Can't find package "google.golang.org/api/googleapi" in $GOPATH: cannot find package "google.golang.org/api/googleapi" in any of:
	/home/mik/go_appengine/goroot/src/google.golang.org/api/googleapi (from $GOROOT)
	/home/mik/go-programs/src/google.golang.org/api/googleapi (from $GOPATH)
	/home/mik/goroot/pkg/src/google.golang.org/api/googleapi
	/home/mik/go_appengine/src/google.golang.org/api/googleapi
2015/03/14 23:13:37 Can't find package "google.golang.org/api/storage/v1" in $GOPATH: cannot find package "google.golang.org/api/storage/v1" in any of:
	/home/mik/go_appengine/goroot/src/google.golang.org/api/storage/v1 (from $GOROOT)
	/home/mik/go-programs/src/google.golang.org/api/storage/v1 (from $GOPATH)
	/home/mik/goroot/pkg/src/google.golang.org/api/storage/v1
	/home/mik/go_appengine/src/google.golang.org/api/storage/v1
2015/03/14 23:13:37 go-app-builder: build timing: 5×6g (223ms total), 0×gopack (0 total), 0×6l (0 total)
2015/03/14 23:13:37 go-app-builder: failed running 6g: exit status 1

答案1

得分: 1

谷歌已经更改了他们的代码库,我错过了这个消息...

google-api-go-client

所以解决方案是使用go get获取它,然后一切都会正常工作。

go get -u google.golang.org/api/storage/v1

英文:

Google has change thire repository and i missed it...

google-api-go-client

So the solution is to do go get to that and evrthing working fine.

go get -u google.golang.org/api/storage/v1

huangapple
  • 本文由 发表于 2015年3月15日 05:15:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/29054298.html
匿名

发表评论

匿名网友

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

确定