[jira] [Comment Edited] (THRIFT-4260) Go context generation issue. Context is parameter in Interface not in implementation

2017-07-23 Thread Bas van Beek (JIRA)

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

Bas van Beek edited comment on THRIFT-4260 at 7/23/17 10:22 AM:


That will not work for Go unless I would vendor the Go thrift library in my 
library (zipkin-go-opentracing). Vendoring of libraries in libraries is a big 
no no in Go land.

But that's not really the problem I'm experiencing here...

The problem is the Scribe interface not being satisfied by *ScribeClient which 
previously was the case.


was (Author: basvanbeek):
That will not work for Go unless I would vendor the Go thrift library in my 
library (zipkin-go-opentracing). Vendoring of libraries in libraries is a big 
no no in Go land.

> Go context generation issue. Context is parameter in Interface not in 
> implementation
> 
>
> Key: THRIFT-4260
> URL: https://issues.apache.org/jira/browse/THRIFT-4260
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Compiler
>Affects Versions: 0.11.0
>Reporter: Bas van Beek
>Assignee: taozle
>Priority: Blocker
>
> Unfortunately the Go library was updated before a new Compiler was released. 
> Having thrift compiled code be part in a project prior to the thrift context 
> library addition breaks due to the dependency on the thrift go library. See: 
> https://github.com/openzipkin/zipkin-go-opentracing/issues/68
> I tried to resolve be installing compiler from latest source but found the 
> generated source to be incorrect. The generated Go interface for the service 
> client includes context.Context as the first parameter of the service method. 
> The generated client implementation however does not.
> The following thrift code:
> {code:none}
> enum ResultCode
> {
>   OK,
>   TRY_LATER
> }
> struct LogEntry
> {
>   1:  string category,
>   2:  string message
> }
> service Scribe
> {
>   ResultCode Log(1: list messages);
> }
> {code}
> Generated the following Go code:
> {code:none}
> type Scribe interface {
>   // Parameters:
>   //  - Messages
>   Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
> }
> ...
> // Parameters:
> //  - Messages
> func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
>   if err = p.sendLog(messages); err != nil {
>   return
>   }
>   return p.recvLog()
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (THRIFT-4260) Go context generation issue. Context is parameter in Interface not in implementation

2017-07-23 Thread Bas van Beek (JIRA)

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

Bas van Beek commented on THRIFT-4260:
--

That will not work for Go unless I would vendor the Go thrift library in my 
library (zipkin-go-opentracing). Vendoring of libraries in libraries is a big 
no no in Go land.

> Go context generation issue. Context is parameter in Interface not in 
> implementation
> 
>
> Key: THRIFT-4260
> URL: https://issues.apache.org/jira/browse/THRIFT-4260
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Compiler
>Affects Versions: 0.11.0
>Reporter: Bas van Beek
>Assignee: taozle
>Priority: Blocker
>
> Unfortunately the Go library was updated before a new Compiler was released. 
> Having thrift compiled code be part in a project prior to the thrift context 
> library addition breaks due to the dependency on the thrift go library. See: 
> https://github.com/openzipkin/zipkin-go-opentracing/issues/68
> I tried to resolve be installing compiler from latest source but found the 
> generated source to be incorrect. The generated Go interface for the service 
> client includes context.Context as the first parameter of the service method. 
> The generated client implementation however does not.
> The following thrift code:
> {code:none}
> enum ResultCode
> {
>   OK,
>   TRY_LATER
> }
> struct LogEntry
> {
>   1:  string category,
>   2:  string message
> }
> service Scribe
> {
>   ResultCode Log(1: list messages);
> }
> {code}
> Generated the following Go code:
> {code:none}
> type Scribe interface {
>   // Parameters:
>   //  - Messages
>   Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
> }
> ...
> // Parameters:
> //  - Messages
> func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
>   if err = p.sendLog(messages); err != nil {
>   return
>   }
>   return p.recvLog()
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (THRIFT-4260) Go context generation issue. Context is parameter in Interface not in implementation

2017-07-23 Thread Bas van Beek (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-4260?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bas van Beek updated THRIFT-4260:
-
Description: 
Unfortunately the Go library was updated before a new Compiler was released. 
Having thrift compiled code be part in a project prior to the thrift context 
library addition breaks due to the dependency on the thrift go library. See: 
https://github.com/openzipkin/zipkin-go-opentracing/issues/68

I tried to resolve be installing compiler from latest source but found the 
generated source to be incorrect. The generated Go interface for the service 
client includes context.Context as the first parameter of the service method. 
The generated client implementation however does not.

The following thrift code:


{code:none}
enum ResultCode
{
  OK,
  TRY_LATER
}

struct LogEntry
{
  1:  string category,
  2:  string message
}

service Scribe
{
  ResultCode Log(1: list messages);
}
{code}


Generated the following Go code:


{code:none}
type Scribe interface {
// Parameters:
//  - Messages
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
}

...

// Parameters:
//  - Messages
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
if err = p.sendLog(messages); err != nil {
return
}
return p.recvLog()
}

{code}





  was:
Unfortunately the Go library was updated before a new Compiler was released. 
Having thrift compiled code be part in a project prior to the thrift context 
library addition breaks due to the dependency on the thrift go library. See: 
https://github.com/openzipkin/zipkin-go-opentracing/issues/68

I tried to resolve be installing compiler from latest source but found the 
generated source to be incorrect. The generated Go interface for the service 
client includes context.Context as the first parameter of the service method. 
The generated client implementation however does not.

The following thrift code:


{code:go}
enum ResultCode
{
  OK,
  TRY_LATER
}

struct LogEntry
{
  1:  string category,
  2:  string message
}

service Scribe
{
  ResultCode Log(1: list messages);
}
{code}


Generated the following Go code:


{code:go}
type Scribe interface {
// Parameters:
//  - Messages
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
}

...

// Parameters:
//  - Messages
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
if err = p.sendLog(messages); err != nil {
return
}
return p.recvLog()
}

{code}






> Go context generation issue. Context is parameter in Interface not in 
> implementation
> 
>
> Key: THRIFT-4260
> URL: https://issues.apache.org/jira/browse/THRIFT-4260
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Compiler
>Affects Versions: 0.11.0
>Reporter: Bas van Beek
>
> Unfortunately the Go library was updated before a new Compiler was released. 
> Having thrift compiled code be part in a project prior to the thrift context 
> library addition breaks due to the dependency on the thrift go library. See: 
> https://github.com/openzipkin/zipkin-go-opentracing/issues/68
> I tried to resolve be installing compiler from latest source but found the 
> generated source to be incorrect. The generated Go interface for the service 
> client includes context.Context as the first parameter of the service method. 
> The generated client implementation however does not.
> The following thrift code:
> {code:none}
> enum ResultCode
> {
>   OK,
>   TRY_LATER
> }
> struct LogEntry
> {
>   1:  string category,
>   2:  string message
> }
> service Scribe
> {
>   ResultCode Log(1: list messages);
> }
> {code}
> Generated the following Go code:
> {code:none}
> type Scribe interface {
>   // Parameters:
>   //  - Messages
>   Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
> }
> ...
> // Parameters:
> //  - Messages
> func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
>   if err = p.sendLog(messages); err != nil {
>   return
>   }
>   return p.recvLog()
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (THRIFT-4260) Go context generation issue. Context is parameter in Interface not in implementation

2017-07-23 Thread Bas van Beek (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-4260?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bas van Beek updated THRIFT-4260:
-
Description: 
Unfortunately the Go library was updated before a new Compiler was released. 
Having thrift compiled code be part in a project prior to the thrift context 
library addition breaks due to the dependency on the thrift go library. See: 
https://github.com/openzipkin/zipkin-go-opentracing/issues/68

I tried to resolve be installing compiler from latest source but found the 
generated source to be incorrect. The generated Go interface for the service 
client includes context.Context as the first parameter of the service method. 
The generated client implementation however does not.

The following thrift code:


{code:go}
enum ResultCode
{
  OK,
  TRY_LATER
}

struct LogEntry
{
  1:  string category,
  2:  string message
}

service Scribe
{
  ResultCode Log(1: list messages);
}
{code}


Generated the following Go code:


{code:go}
type Scribe interface {
// Parameters:
//  - Messages
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
}

...

// Parameters:
//  - Messages
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
if err = p.sendLog(messages); err != nil {
return
}
return p.recvLog()
}

{code}





  was:
Unfortunately the Go library was updated before a new Compiler was released. 
Having thrift compiled code be part in a project prior to the thrift context 
library addition breaks due to the dependency on the thrift go library. See: 
https://github.com/openzipkin/zipkin-go-opentracing/issues/68

I tried to resolve be installing compiler from latest source but found the 
generated source to be incorrect. The generated Go interface for the service 
client includes context.Context as the first parameter of the service method. 
The generated client implementation however does not.

The following thrift code:

enum ResultCode
{
  OK,
  TRY_LATER
}

struct LogEntry
{
  1:  string category,
  2:  string message
}

service Scribe
{
  ResultCode Log(1: list messages);
}

Generated the following Go code:

type Scribe interface {
// Parameters:
//  - Messages
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
}

...

// Parameters:
//  - Messages
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
if err = p.sendLog(messages); err != nil {
return
}
return p.recvLog()
}






> Go context generation issue. Context is parameter in Interface not in 
> implementation
> 
>
> Key: THRIFT-4260
> URL: https://issues.apache.org/jira/browse/THRIFT-4260
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Compiler
>Affects Versions: 0.11.0
>Reporter: Bas van Beek
>
> Unfortunately the Go library was updated before a new Compiler was released. 
> Having thrift compiled code be part in a project prior to the thrift context 
> library addition breaks due to the dependency on the thrift go library. See: 
> https://github.com/openzipkin/zipkin-go-opentracing/issues/68
> I tried to resolve be installing compiler from latest source but found the 
> generated source to be incorrect. The generated Go interface for the service 
> client includes context.Context as the first parameter of the service method. 
> The generated client implementation however does not.
> The following thrift code:
> {code:go}
> enum ResultCode
> {
>   OK,
>   TRY_LATER
> }
> struct LogEntry
> {
>   1:  string category,
>   2:  string message
> }
> service Scribe
> {
>   ResultCode Log(1: list messages);
> }
> {code}
> Generated the following Go code:
> {code:go}
> type Scribe interface {
>   // Parameters:
>   //  - Messages
>   Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
> }
> ...
> // Parameters:
> //  - Messages
> func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
>   if err = p.sendLog(messages); err != nil {
>   return
>   }
>   return p.recvLog()
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (THRIFT-4260) Go context generation issue. Context is parameter in Interface not in implementation

2017-07-23 Thread Bas van Beek (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-4260?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bas van Beek updated THRIFT-4260:
-
Description: 
Unfortunately the Go library was updated before a new Compiler was released. 
Having thrift compiled code be part in a project prior to the thrift context 
library addition breaks due to the dependency on the thrift go library. See: 
https://github.com/openzipkin/zipkin-go-opentracing/issues/68

I tried to resolve be installing compiler from latest source but found the 
generated source to be incorrect. The generated Go interface for the service 
client includes context.Context as the first parameter of the service method. 
The generated client implementation however does not.

The following thrift code:

enum ResultCode
{
  OK,
  TRY_LATER
}

struct LogEntry
{
  1:  string category,
  2:  string message
}

service Scribe
{
  ResultCode Log(1: list messages);
}

Generated the following Go code:

type Scribe interface {
// Parameters:
//  - Messages
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
}

...

// Parameters:
//  - Messages
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
if err = p.sendLog(messages); err != nil {
return
}
return p.recvLog()
}





  was:
Unfortunately the Go library was updated before a new Compiler was released. 
Having thrift compiled code be part in a project prior to the thrift context 
library addition breaks due to the dependency on the thrift go library. See: 
https://github.com/openzipkin/zipkin-go-opentracing/issues/68

I tried to resolve be installing compiler from latest source but found the 
generated source to be incorrect. The generated Go interface for the service 
client includes context.Context as the first parameter of the service method. 
The generated client implementation however does not.

The following thrift code:

{{
enum ResultCode
{
  OK,
  TRY_LATER
}

struct LogEntry
{
  1:  string category,
  2:  string message
}

service Scribe
{
  ResultCode Log(1: list messages);
}
}}

Generated the following Go code:
{{
type Scribe interface {
// Parameters:
//  - Messages
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
}

...

// Parameters:
//  - Messages
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
if err = p.sendLog(messages); err != nil {
return
}
return p.recvLog()
}

}}






> Go context generation issue. Context is parameter in Interface not in 
> implementation
> 
>
> Key: THRIFT-4260
> URL: https://issues.apache.org/jira/browse/THRIFT-4260
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Compiler
>Affects Versions: 0.11.0
>Reporter: Bas van Beek
>
> Unfortunately the Go library was updated before a new Compiler was released. 
> Having thrift compiled code be part in a project prior to the thrift context 
> library addition breaks due to the dependency on the thrift go library. See: 
> https://github.com/openzipkin/zipkin-go-opentracing/issues/68
> I tried to resolve be installing compiler from latest source but found the 
> generated source to be incorrect. The generated Go interface for the service 
> client includes context.Context as the first parameter of the service method. 
> The generated client implementation however does not.
> The following thrift code:
> enum ResultCode
> {
>   OK,
>   TRY_LATER
> }
> struct LogEntry
> {
>   1:  string category,
>   2:  string message
> }
> service Scribe
> {
>   ResultCode Log(1: list messages);
> }
> Generated the following Go code:
> type Scribe interface {
>   // Parameters:
>   //  - Messages
>   Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
> }
> ...
> // Parameters:
> //  - Messages
> func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
>   if err = p.sendLog(messages); err != nil {
>   return
>   }
>   return p.recvLog()
> }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (THRIFT-4260) Go context generation issue. Context is parameter in Interface not in implementation

2017-07-23 Thread Bas van Beek (JIRA)
Bas van Beek created THRIFT-4260:


 Summary: Go context generation issue. Context is parameter in 
Interface not in implementation
 Key: THRIFT-4260
 URL: https://issues.apache.org/jira/browse/THRIFT-4260
 Project: Thrift
  Issue Type: Bug
  Components: Go - Compiler
Affects Versions: 0.11.0
Reporter: Bas van Beek


Unfortunately the Go library was updated before a new Compiler was released. 
Having thrift compiled code be part in a project prior to the thrift context 
library addition breaks due to the dependency on the thrift go library. See: 
https://github.com/openzipkin/zipkin-go-opentracing/issues/68

I tried to resolve be installing compiler from latest source but found the 
generated source to be incorrect. The generated Go interface for the service 
client includes context.Context as the first parameter of the service method. 
The generated client implementation however does not.

The following thrift code:

{{
enum ResultCode
{
  OK,
  TRY_LATER
}

struct LogEntry
{
  1:  string category,
  2:  string message
}

service Scribe
{
  ResultCode Log(1: list messages);
}
}}

Generated the following Go code:
{{
type Scribe interface {
// Parameters:
//  - Messages
Log(ctx context.Context, messages []*LogEntry) (r ResultCode, err error)
}

...

// Parameters:
//  - Messages
func (p *ScribeClient) Log(messages []*LogEntry) (r ResultCode, err error) {
if err = p.sendLog(messages); err != nil {
return
}
return p.recvLog()
}

}}







--
This message was sent by Atlassian JIRA
(v6.4.14#64029)