You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using go-micro to generate gRPC code, using their custom protoc tool. However, when I generate my gRPC stub using go-micro, then attempt to generate a restful proxy using this library, I get a few conflicting errors.
./models.pb.gw.go:53: cannot use grpc.Header(&metadata.HeaderMD) (type grpc.CallOption) as type client.CallOption in argument to client.Get
./models.pb.gw.go:53: cannot use grpc.Trailer(&metadata.TrailerMD) (type grpc.CallOption) as type client.CallOption in argument to client.Get
./models.pb.gw.go:70: cannot use grpc.Header(&metadata.HeaderMD) (type grpc.CallOption) as type client.CallOption in argument to client.GetAll
./models.pb.gw.go:70: cannot use grpc.Trailer(&metadata.TrailerMD) (type grpc.CallOption) as type client.CallOption in argument to client.GetAll
./models.pb.gw.go:83: cannot use grpc.Header(&metadata.HeaderMD) (type grpc.CallOption) as type client.CallOption in argument to client.Post
./models.pb.gw.go:83: cannot use grpc.Trailer(&metadata.TrailerMD) (type grpc.CallOption) as type client.CallOption in argument to client.Post
./models.pb.gw.go:114: cannot use grpc.Header(&metadata.HeaderMD) (type grpc.CallOption) as type client.CallOption in argument to client.Patch
./models.pb.gw.go:114: cannot use grpc.Trailer(&metadata.TrailerMD) (type grpc.CallOption) as type client.CallOption in argument to client.Patch
./models.pb.gw.go:141: cannot use grpc.Header(&metadata.HeaderMD) (type grpc.CallOption) as type client.CallOption in argument to client.Delete
./models.pb.gw.go:173: RegisterMenusHandler redeclared in this block
previous declaration at ./models.pb.go:598
./models.pb.gw.go:141: too many errors
I've checked through the generated code and go-micro does generate a RegisterMenusHandler within the same package unfortunately.
Have you come across this issue before? Or used go-micro at all? Just wondered if anyone has found a way around this?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Our project is only set up to support golang/protobuf and gogo/gogoproto directly. It sounds like go-micro isn't exposing all the functionality grpc-gateway needs to work. Maybe you could extend go-micro to expose that information? I'm going to close this since it doesn't seem like an issue with grpc-gateway directly.
I also encounter this kind of problem, how to solve? thank!
.pb.gw.go:43:91: cannot use &metadata.TrailerMD (type *"google. golang.org/grpc/metadata".MD) as type *"win-his/vendor/google.golang.org/grpc/me tadata".MD in argument to grpc.Trailer
This is a vendor problem. You've got one version of the metadata package in vendor and another version in the GOPATH. Easiest thing is to remove the package in the GOPATH.
I'm using go-micro to generate gRPC code, using their custom protoc tool. However, when I generate my gRPC stub using go-micro, then attempt to generate a restful proxy using this library, I get a few conflicting errors.
I've checked through the generated code and go-micro does generate a
RegisterMenusHandler
within the same package unfortunately.Have you come across this issue before? Or used go-micro at all? Just wondered if anyone has found a way around this?
Thanks in advance!
The text was updated successfully, but these errors were encountered: