Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echo service example does not compile #117

Closed
diogomonica opened this issue Mar 1, 2016 · 5 comments
Closed

echo service example does not compile #117

diogomonica opened this issue Mar 1, 2016 · 5 comments

Comments

@diogomonica
Copy link

➜ go build
# github.com/gengo/grpc-gateway/examples/examplepb
examplepb/echo_service.pb.go:114: cannot use _EchoService_Echo_Handler (type func(interface {}, context.Context, grpc.Codec, []byte) (interface {}, error)) as type grpc.methodHandler in field value
examplepb/echo_service.pb.go:118: cannot use _EchoService_EchoBody_Handler (type func(interface {}, context.Context, grpc.Codec, []byte) (interface {}, error)) as type grpc.methodHandler in field value
@diogomonica diogomonica changed the title examples do not compile echo service example does not compile Mar 1, 2016
@yugui
Copy link
Member

yugui commented Mar 1, 2016

I guess the revision of google.golang.org/grpc you have is inconsistent to the example.
Could you try running go get -u google.golang.org/grpc to update the revision?

@diogomonica
Copy link
Author

I'm on 0e69ad1, so latest master.

@diogomonica
Copy link
Author

It seems to build now. Probably screwed up along somewhere. Thank you.

@diogomonica
Copy link
Author

The generated protos that are currently in the repository work, but when regenerating using the instructions:

➜ protoc -I/usr/local/include -I. \
 -I$GOPATH/src \     
 -I$GOPATH/src/github.com/gengo/grpc-gateway/third_party/googleapis \
 --go_out=Mgoogle/api/annotations.proto=github.com/gengo/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. echo_service.proto
➜ protoc -I/usr/local/include -I. \
 -I$GOPATH/src \     
 -I$GOPATH/src/github.com/gengo/grpc-gateway/third_party/googleapis \
 --grpc-gateway_out=logtostderr=true:. echo_service.proto

Using protoc:

➜  protoc --version
libprotoc 3.0.0

And with go-grpc on 0e69ad1 (master) from 9 hours ago, and grpc-gateway on 67e1374 (master), I still get:

➜  go build 
# github.com/gengo/grpc-gateway/examples/examplepb
examplepb/echo_service.pb.go:114: cannot use _EchoService_Echo_Handler (type func(interface {}, context.Context, grpc.Codec, []byte) (interface {}, error)) as type grpc.methodHandler in field value
examplepb/echo_service.pb.go:118: cannot use _EchoService_EchoBody_Handler (type func(interface {}, context.Context, grpc.Codec, []byte) (interface {}, error)) as type grpc.methodHandler in field value

@yugui
Copy link
Member

yugui commented Mar 2, 2016

Can't reproduce.

Another possible guess is that your protoc-gen-go is out-of-date. What happens if you run go get -u github.com/golang/protobuf/protoc-gen-go then try it again?

@yugui yugui closed this as completed Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants