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 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题