douwen9343 2014-11-29 00:20
浏览 51
已采纳

演示项目中的Appengine云存储编译错误

Following https://cloud.google.com/appengine/docs/go/googlecloudstorageclient/getstarted fails when deploying

goapp deploy -oauth

with

app.go:78: cannot use google.AppEngineContext(c) (type "golang.org/x/oauth2".Option) as type "github.com/golang/oauth2".Option in function argument

I'm able to get the demo project to run by altering the import lines 33-34 in google.golang.org/cloud/examples/storage/appengine/app.go from

"github.com/golang/oauth2" "github.com/golang/oauth2/google"

to

"golang.org/x/oauth2" "golang.org/x/oauth2/google"

Most importantly, is this the right way to "fix" this (and should the demo project be / or have been updated by google?) And if anyone has insight, if you could provide some context as to why there are (as it appears to me) multiple ways to refer to the same package that would be great as well.

  • 写回答

1条回答 默认 最新

  • dongluxin2452 2014-12-01 11:45
    关注

    Yes, the go subrepositories have been moved to golang.org/x/...

    See the announcement: https://groups.google.com/forum/#!msg/golang-nuts/eD8dh3T9yyA/l5Ail-xfMiAJ

    The problem with identifying the canonical import path will be addressed in Go 1.4: https://docs.google.com/document/d/1jVFkZTcYbNLaTxXD9OcGfn7vYv5hWtPx9--lTx1gPMs

    It seems there is indeed a problem with the examples. The oauth library refers to the golang.org/x/... paths with the recent commit.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?
  • ¥15 关于#vue.js#的问题:修改用户信息功能图片无法回显,数据库中只存了一张图片(相关搜索:字符串)
  • ¥15 texstudio的问题,
  • ¥15 spaceclaim模型变灰色
  • ¥15 求一份华为esight平台V300R009C00SPC200这个型号的api接口文档
  • ¥15 就很莫名其妙,本来正常的Excel,突然变成了这种一格一页
  • ¥15 字符串比较代码的漏洞
  • ¥15 欧拉系统opt目录空间使用100%