Updated Branches:
  refs/heads/master ec8744c4d -> c949514e4

THRIFT-2170 Generated Go code should populate all ReadErrors completely

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/c949514e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/c949514e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/c949514e

Branch: refs/heads/master
Commit: c949514e41f9e2b31b061f1d81fd5305d0861a46
Parents: ec8744c
Author: Jens Geyer <[email protected]>
Authored: Sun Sep 8 00:31:20 2013 +0200
Committer: Jens Geyer <[email protected]>
Committed: Sun Sep 8 00:31:59 2013 +0200

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_go_generator.cc | 2 +-
 tutorial/go/src/main.go                     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/c949514e/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 eecc836..24af687 100644
--- a/compiler/cpp/src/generate/t_go_generator.cc
+++ b/compiler/cpp/src/generate/t_go_generator.cc
@@ -1129,7 +1129,7 @@ void t_go_generator::generate_go_struct_reader(ofstream& 
out,
     indent_up();
     out <<
         indent() << "if _, err := iprot.ReadStructBegin(); err != nil {" << 
endl <<
-        indent() << "  return fmt.Errorf(\"%T read error\", p)" << endl <<
+        indent() << "  return fmt.Errorf(\"%T read error: %s\", p, err)" << 
endl <<
         indent() << "}" << endl;
     // Loop over reading in fields
     indent(out) << "for {" << endl;

http://git-wip-us.apache.org/repos/asf/thrift/blob/c949514e/tutorial/go/src/main.go
----------------------------------------------------------------------
diff --git a/tutorial/go/src/main.go b/tutorial/go/src/main.go
index 96e5ec9..63154e3 100644
--- a/tutorial/go/src/main.go
+++ b/tutorial/go/src/main.go
@@ -35,7 +35,7 @@ func Usage() {
 func main() {
        flag.Usage = Usage
        server := flag.Bool("server", false, "Run server")
-       protocol := flag.String("P", "binary", "Specify the protocol (binary, 
compact, simplejson)")
+       protocol := flag.String("P", "binary", "Specify the protocol (binary, 
compact, json, simplejson)")
        framed := flag.Bool("framed", false, "Use framed transport")
        buffered := flag.Bool("buffered", false, "Use buffered transport")
        addr := flag.String("addr", "localhost:9090", "Address to listen to")

Reply via email to