小编mud*_*jar的帖子

如何使用grpc方法处理程序解决此问题

我是golang的新手,想要尝试使用grpc代码来更好地理解它.为了做到这一点,我按照这里显示的示例:

https://devicharan.wordpress.com/

源代码在这里:https: //github.com/devicharan/basicwebapp

不幸的是,当我运行此代码并执行go build时,我收到一条错误消息,其中包含以下内容:

# basicwebapp/proto
proto/CatalogService.pb.go:126: cannot use _CatalogService_GetProductCatalog_Handler (type func(interface {},   context.Context, []byte) (proto.Message, error)) as type grpc.methodHandler in field value
proto/RecommendationService.pb.go:99: cannot use _RecommendationService_GetRecommendations_Handler (type func(interface {}, context.Context, []byte) (proto.Message, error)) as type grpc.methodHandler in field value
Run Code Online (Sandbox Code Playgroud)

我不知道这意味着什么或我需要改变什么才能开始寻找修复.这是代码本身还是Go配置的问题?另外,有人可以推荐一个很好的Go调试器吗?

以下是CatalogService.pb.go的代码:

// Code generated by protoc-gen-go.
// source: CatalogService.proto
// DO NOT EDIT!

/*
Package protos is a generated protocol buffer package.

It is generated from these files:
    CatalogService.proto
    Product.proto
    RecommendationService.proto

It has these top-level …
Run Code Online (Sandbox Code Playgroud)

rpc go grpc

2
推荐指数
1
解决办法
4443
查看次数

标签 统计

go ×1

grpc ×1

rpc ×1