Hi Paolo,
There was a backwards incompatible change introduced into the library
that required contexts to be passed to all generated functions in
0.11.0. It looks like those changes were propagated to the tutorial
which is unfortunate.
All that really needs to be done in order for the example to work is to
add context.TODO()[1] wherever the compiler complains that a function
needs a context argument.
Hope that helps!
- Renan
[1] https://golang.org/pkg/context/#TODO
On 8/7/20 8:07 AM, Paolo Elefante wrote:
Hi there,
I have a problem with the thrift tutorial/go (
https://thrift.apache.org/tutorial/go)
I'm on ubuntu, thrift 0.13.0 and go 1.14.6.
When running the tutorialclient and tutorialserver I see erorrs you can see
below.
I actually see that ReadStructBegin defined in thrift/protocol.go requires
one argument (context.Context), but the generated shared.go doesn't pass it.
I'm wondering if there's a fault in the thrift compiler for go.
Did anyone observed the same thing?
# shared
../../GOEXT/src/shared/shared.go:42:37: not enough arguments in call to
iprot.ReadStructBegin
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:48:57: not enough arguments in call to
iprot.ReadFieldBegin
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:60:29: not enough arguments in call to
iprot.Skip
have (thrift.TType)
want (context.Context, thrift.TType)
../../GOEXT/src/shared/shared.go:79:33: not enough arguments in call to
iprot.ReadFieldEnd
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:83:32: not enough arguments in call to
iprot.ReadStructEnd
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:90:29: not enough arguments in call to
iprot.ReadI32
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:99:32: not enough arguments in call to
iprot.ReadString
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:108:35: not enough arguments in call to
oprot.WriteStructBegin
have (string)
want (context.Context, string)
../../GOEXT/src/shared/shared.go:114:33: not enough arguments in call to
oprot.WriteFieldStop
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:116:33: not enough arguments in call to
oprot.WriteStructEnd
have ()
want (context.Context)
../../GOEXT/src/shared/shared.go:116:33: too many errors
Any help is appreciated.
BR, Paolo