[GitHub] thrift issue #1309: Use build tags to support context.
Github user dcelasun commented on the issue: https://github.com/apache/thrift/pull/1309 Hmm, turns out @taozle already [updated](https://github.com/apache/thrift/blob/c0d384a38c2b43ee47cef86b1cd054e3f84dc909/tutorial/go/Makefile.am#L37) the Makefile for the tutorial, I just missed it somehow. The `check` target already includes `thirdparty-dep`, so it should work with `make -k check` when you are running Go<1.7. What were your exact steps that resulted in this error? What's your Go version? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] thrift pull request #1311: Fix for constant assignments to optional fields i...
Github user Jens-G commented on a diff in the pull request: https://github.com/apache/thrift/pull/1311#discussion_r128901829 --- Diff: compiler/cpp/src/thrift/generate/t_go_generator.cc --- @@ -424,6 +424,52 @@ bool t_go_generator::is_pointer_field(t_field* tfield, bool in_container_value) throw "INVALID TYPE IN type_to_go_type: " + type->get_name(); } +string t_go_generator::gen_opt_const_values_(t_base_type::t_base tbase, t_const_value *value) { + string go_value_str = "&({x "; + switch (tbase) { +case t_base_type::TYPE_BOOL: + go_value_str += "bool}{"; + go_value_str += (value->get_integer() > 0 ? "true" : "false"); + break; + +case t_base_type::TYPE_I8: + go_value_str += "int8}{"; + go_value_str += std::to_string(static_cast(value->get_integer())); + break; --- End diff -- Three questions: a) Why are these casts needed? b) Can we move that whole method next to the other method? c) Why do we need two separate methods at all? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[jira] [Commented] (THRIFT-4236) Support context in go generated code.
[ https://issues.apache.org/jira/browse/THRIFT-4236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16097390#comment-16097390 ] ASF GitHub Bot commented on THRIFT-4236: Github user asfgit closed the pull request at: https://github.com/apache/thrift/pull/1309 > 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)
[GitHub] thrift pull request #1309: Use build tags to support context.
Github user asfgit closed the pull request at: https://github.com/apache/thrift/pull/1309 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] thrift issue #1309: Use build tags to support context.
Github user Jens-G commented on the issue: https://github.com/apache/thrift/pull/1309 > I'll also be sending a PR to update the Go tutorial with the new handler signature. Please do. Right now the tutorial does not build. ``` handler.go:30:2: cannot find package "golang.org/x/net/context" in any of: C:\Go\src\golang.org\x\net\context (from $GOROOT) D:\Workdir\src\golang.org\x\net\context (from $GOPATH) ``` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---