You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2013/09/10 21:35:53 UTC

[2/3] git commit: THRIFT-2175 Wrong field type set for binary

THRIFT-2175 Wrong field type set for binary

Patch: Jens Geyer


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/901d5552
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/901d5552
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/901d5552

Branch: refs/heads/master
Commit: 901d5552963224ed48c2c53da685771456f7fb98
Parents: 8a0f8d1
Author: Jens Geyer <je...@apache.org>
Authored: Tue Sep 10 21:33:17 2013 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Tue Sep 10 21:34:43 2013 +0200

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_go_generator.cc | 3 ++-
 lib/go/thrift/serializer_types.go           | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/901d5552/compiler/cpp/src/generate/t_go_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_go_generator.cc b/compiler/cpp/src/generate/t_go_generator.cc
index 24af687..00af893 100644
--- a/compiler/cpp/src/generate/t_go_generator.cc
+++ b/compiler/cpp/src/generate/t_go_generator.cc
@@ -3129,10 +3129,11 @@ string t_go_generator::type_to_enum(t_type* type)
             throw "NO T_VOID CONSTRUCT";
 
         case t_base_type::TYPE_STRING:
+            /* this is wrong, binary is still a string type internally
             if (((t_base_type*)type)->is_binary()) {
                 return "thrift.BINARY";
             }
-
+            */
             return "thrift.STRING";
 
         case t_base_type::TYPE_BOOL:

http://git-wip-us.apache.org/repos/asf/thrift/blob/901d5552/lib/go/thrift/serializer_types.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/serializer_types.go b/lib/go/thrift/serializer_types.go
index 2ce353b..8416b85 100644
--- a/lib/go/thrift/serializer_types.go
+++ b/lib/go/thrift/serializer_types.go
@@ -470,7 +470,7 @@ func (p *TestStruct) writeField7(oprot TProtocol) (err error) {
 
 func (p *TestStruct) writeField8(oprot TProtocol) (err error) {
 	if p.Bin != nil {
-		if err := oprot.WriteFieldBegin("bin", BINARY, 8); err != nil {
+		if err := oprot.WriteFieldBegin("bin", STRING, 8); err != nil {
 			return fmt.Errorf("%T write field begin error 8:bin: %s", p, err)
 		}
 		if err := oprot.WriteBinary(p.Bin); err != nil {