[
https://issues.apache.org/jira/browse/THRIFT-4236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083445#comment-16083445
]
Can Celasun commented on THRIFT-4236:
-------------------------------------
I realize I'm a bit late to notice this PR since it's already merged, but I
think introducing a hard dependency on Go 1.7+ is the wrong way to go about
this, and so is making it default.
The correct way of handling these situations is to use [build
tags|https://golang.org/pkg/go/build/#hdr-Build_Constraints]. So, any file that
uses "context" directly should have a "go1.7" build tag and a "_go17" suffix in
the filename. The default file should either not import context at all, or do
so using "golang.org/x/net/context".
I believe it would be a mistake to release 0.11 without the above changes, so
it should either be fixed before then or just reverted for 0.11.
[~taozle] [~jensg] thoughts?
> Support context in go generated code.
> -------------------------------------
>
> Key: THRIFT-4236
> URL: https://issues.apache.org/jira/browse/THRIFT-4236
> Project: Thrift
> Issue Type: Improvement
> Components: Go - Compiler, Go - Library
> Reporter: taozle
> Assignee: taozle
> Fix For: 0.11.0
>
>
> Since context is widely used in go's community, and there is lots of
> advantage to use context such as control timeout, carry extra info in one
> request etc, so is there any plan for this? i just searched the issues but
> didn't find anything about this.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)