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#357895182 -
https://github.com/grpc/grpc-go/issues/656and also asked on gophers slack channel about the steps I've taken to solve the issue:
a) `rm -rf $GOPATH/src/
github.com/grpc` and `rm -rf $GOPATH/bin/protoc-gen-go` and the same for `$GOPATH/src/
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!