twitchtv / twirp

A simple RPC framework with protobuf service definitions
https://twitchtv.github.io/twirp/docs/intro.html
Apache License 2.0
7.12k stars 326 forks source link

clientOpts.ReadOpt undefined (type twirp.ClientOptions has no field or method ReadOpt) #324

Closed AvivM96 closed 3 years ago

AvivM96 commented 3 years ago

Hey,

First of all I love twirp and thanks for all the hard work it is really appreciated !

I've noticed a change that happened a few days ago, an addition to protoc-gen-twirp. I'm generating golang protobuf client using protoc-gen-twirp but suddenly the build is failing dues to those error messages -

clientOpts.ReadOpt undefined (type twirp.ClientOptions has no field or method ReadOpt)
serverOpts.ReadOpt undefined (type *twirp.ServerOptions has no field or method ReadOpt)

In my golang protos client I'm using the latest twirp package - github.com/twitchtv/twirp v8.0.0+incompatible When I'm checking the lib I do see that ReadOpt method is missing from client_options.go.

what am I doing wrong ?

marioizquierdo commented 3 years ago

Sorry for the confusion! There are a few commits on master that have not been released yet. It seems that you are using the right package version for the runtime library, but the protoc-gen-twirp code generator must be pulling from the main branch, instead of the v8.0.0 tag.

Try installing the generator with an explicit version like this:

go get github.com/twitchtv/twirp/protoc-gen-twirp@v8.0.0

More info: https://twitchtv.github.io/twirp/docs/install.html

AvivM96 commented 3 years ago

@marioizquierdo great fixed it :) thanks a lot