doushi1912 2018-03-19 02:52
浏览 79
已采纳

将pubsub与golang一起使用:ocgrpc.NewClientStatsHandler

I am following this tutorial to publish a topic to Pub/Sub from a golang project and here's the code I have for that project at the moment:

package main

import "cloud.google.com/go/pubsub"
import "fmt"

func main() {
    fmt.Printf("hello, world
")
}

All it does is simply imports the pubsub but when I run go get I get this error: undefined: ocgrpc.NewClientStatsHandler

C:\Users\iha001\Dev\golang-projects\src\github.com
aguibihab\golang-playarea\src\gcloud>go get
# cloud.google.com/go/pubsub
..\..\..\..\..\cloud.google.com\go\pubsub\go18.go:34:51: undefined: ocgrpc.NewClientStatsHandler

Is there anything else I need to install to get this running?

  • 写回答

2条回答 默认 最新

  • duandian8110 2018-03-19 03:32
    关注

    It seems to have been an issue on the repo:

    @naguibihab This is NOT a windows issue. This commit fixes the problem be072a5. Short explanation: breaking changes where pushed on a minor release of a google pubsub dependency: census-instrumentation/opencensus-go@ac82455, method NewClientStatsHandler was deleted. (They don't claim anywhere they comply with semver).

    Here's the fix mentioned in that comment: https://github.com/GoogleCloudPlatform/google-cloud-go/commit/be072a5d1d73144ae0ce1071e9bd43d1ad221581

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 outlook无法配置成功
  • ¥15 Pwm双极模式H桥驱动控制电机
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换