THRIFT-2170 Generated Go code should populate all ReadErrors completely
Patch: Jens Geyer
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 @@
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;
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 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")