[ 
https://issues.apache.org/jira/browse/THRIFT-5269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183369#comment-17183369
 ] 

Paolo Elefante commented on THRIFT-5269:
----------------------------------------

Hi Duru,
When I compile the tutorialclient and tutorialserver I see erorrs you can see 
below.
I see that ReadStructBegin defined in thrift/protocol.go requires one argument 
(context.Context), but the generated shared.go doesn't pass it.
Note that shared.go is autogenerated with {{thrift -r --gen go tutorial.thrift}}
That's why I'm writing this jira on the thrift compiler for go. 

{code:java}
# 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
{code}

Thanks.
BR, Paolo

> Contexts are missing from GO generated code
> -------------------------------------------
>
>                 Key: THRIFT-5269
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5269
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>    Affects Versions: 0.13.0
>         Environment: ubuntu, thrift 0.13.0, go 1.14.6
>            Reporter: Paolo Elefante
>            Priority: Blocker
>
> Hi,
> [Contexts|https://golang.org/pkg/context/#Context] are missing from golang 
> generated code.
> I'm on ubuntu, thrift 0.13.0 and go 1.14.6.
> To reproduce the fault just follow the Go Tutorial 
> ([link|https://thrift.apache.org/tutorial/go])
> Thanks. 
> BR, Paolo



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to