What was the protoc command you used to generate the pb.go file? It should look something like this: protoc --go_out=plugins=grpc:. *.proto
If that doesn't work, I may need to see something more concrete (e.g. your actual .pb.go file; names redacted if necessary) to help. Can you file an issue in https://github.com/grpc/grpc-go in that case? Thanks, Doug On Thursday, November 30, 2017 at 10:36:35 AM UTC-8, 1306 wrote: > > After protoc generated the .pb.go file from my .proto file, I'm having > issues building my client/server Go programs due to the following error: > > cannot use _<Service>_<RPC-function>_Handler (type func(interface {}, > "context".Context, grpc.Codec, []byte) (interface {}, error)) as type > grpc.methodHandler in field value > > I've tried to follow the steps listed in: > 1 - > https://stackoverflow.com/questions/33506221/how-to-fix-this-issue-with-grpc-method-handler/35789518#35789518 > 2 - https://github.com/grpc/grpc-go/issues/656 > and also asked on gophers slack channel about the steps I've taken to > solve the issue: > a) `rm -rf $GOPATH/src/github.com/grpc` <http://github.com/grpc> and `rm > -rf $GOPATH/bin/protoc-gen-go` and the same for `$GOPATH/src/ > github.com/golang/protobuf` <http://github.com/golang/protobuf> > b) `go get -u ...protobuf` and `go get -u ...grpc` > c) `cd $GOPATH/src/.../protobuf/` and `make` > d) `rm file.pb.go` and `protoc ... file.proto` > e) `rm $GOPATH/src/myrepo/project/pb` > f) `git cm` and `git push` new pb.go to myrepo > g) `go get -u myrepo/project/pb` where I get the first `:cannot use ... as > type grpc.methodHandler in field value` error > h) `go build src/client/main.go` where I get the second `:cannot use ...as > type grpc.methodHandler in field value` error > i'm sure there's something that i'm still doing wrong... > > I'd appreciate if anyone can suggest what I'm doing wrong or any hints in > the right direction. > > Thanks! > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/16aef6a3-5f97-4533-bcae-69343403d027%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
