doujiazong0322 2015-02-21 07:32
浏览 89
已采纳

Google App Engine:request.BasicAuth未定义(类型* http.Request没有字段或方法BasicAuth)

I'm trying to deploy a go app to Google App Engine but compilation is failing because of this error.

request.BasicAuth undefined (type *http.Request has no field or method BasicAuth)

I figured this error meant that my google app engine installation was not the latest one so I updated it and now running go_appengine/goapp version returns:

go version go1.4.1 (appengine-1.9.18) darwin/amd64

I can successfully serve my app but I keep getting this error when I try to deploy. What am I missing?

  • 写回答

1条回答 默认 最新

  • doushi9729 2015-02-21 07:54
    关注

    The Go AppEngine runtime environment uses Go version 1.2 as you can read it on the Go Runtime Environment page.

    A beta version of 1.4 runtime version is available, you can read more about it here:

    go1.4beta is now ready for testing

    If you want to use the 1.4 beta runtime, you have to specify it in your app.yaml config file like this:

    api_version: go1.4beta
    

    Note that even though Go 1.4 is out (current version is 1.4.2), the AppEngine runtime version of 1.4 is still not released.

    Quoting the relevant part:

    Go 1.4 has not yet been released, so the go1.4beta runtime is built from the release-branch.go1.4 of the core Go tree, and may be updated as Go 1.4 approaches.

    We will not be providing a beta version of the Go 1.4 SDK. You should use goapp deploy (or appcfg.py) from the normal Go App Engine SDK to deploy your app.

    To use go1.4beta, update your app.yaml file to use the new api_version:

    api_version: go1.4beta 
    

    After Go 1.4 is released it will become the basis for api_version 'go1', as normal, and 'go1.4beta' will be retired soon afterward. We expect this to happen early next year.

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

报告相同问题?

悬赏问题

  • ¥15 机器学习训练相关模型
  • ¥15 Todesk 远程写代码 anaconda jupyter python3
  • ¥15 我的R语言提示去除连锁不平衡时clump_data报错,图片以下所示,卡了好几天了,苦恼不知道如何解决,有人帮我看看怎么解决吗?
  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制