philips / grpc-gateway-example

https://coreos.com/blog/gRPC-protobufs-swagger.html
Apache License 2.0
637 stars 113 forks source link

build fail #16

Open jinleileiking opened 7 years ago

jinleileiking commented 7 years ago
../../../../../github.com/philips/grpc-gateway-example/echopb/service.pb.gw.go:86: not enough arguments in call to runtime.AnnotateContext
        have ("golang.org/x/net/context".Context, *http.Request)
        want ("golang.org/x/net/context".Context, *runtime.ServeMux, *http.Request)
../../../../../github.com/philips/grpc-gateway-example/echopb/service.pb.gw.go:88: not enough arguments in call to runtime.HTTPError
        have ("golang.org/x/net/context".Context, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
        want ("golang.org/x/net/context".Context, *runtime.ServeMux, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
../../../../../github.com/philips/grpc-gateway-example/echopb/service.pb.gw.go:93: not enough arguments in call to runtime.HTTPError
        have ("golang.org/x/net/context".Context, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
        want ("golang.org/x/net/context".Context, *runtime.ServeMux, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
../../../../../github.com/philips/grpc-gateway-example/echopb/service.pb.gw.go:97: not enough arguments in call to forward_EchoService_Echo_0
        have ("golang.org/x/net/context".Context, runtime.Marshaler, http.ResponseWriter, *http.Request, proto.Message, []func("golang.org/x/net/context".Context, http.ResponseWriter, proto.Message) error...)
        want ("golang.org/x/net/context".Context, *runtime.ServeMux, runtime.Marshaler, http.ResponseWriter, *http.Request, proto.Message, ...func("golang.org/x/net/context".Context, http.ResponseWriter, proto.Message) error)
utopiaprince commented 7 years ago

i get the same problem with you. i found that my protoc version is too new. then i remove the "github.com/grpc-ecosystem/grpc-gateway" from vendor folder. and do this:

go get -u -v github.com/grpc-ecosystem/grpc-gateway

after that, i fixed this problem.

philips commented 7 years ago

@utopiaprince would you be able to send a PR to update the vendor dir?

graphaelli commented 7 years ago

Ran into this too but don't see a vendor so sent a PR to update the code instead.