compiler/cpp/src/generate/t_go_generator.cc
/**
 * Generates an unserializer for a struct, calling read()
 */
Generates an unserializer for a struct, calling read()
Generates an unserializer for a struct calling read ()
void t_go_generator::generate_deserialize_struct(ofstream &out,
                                                  t_struct* tstruct,
                                                  bool declare,
                                                  string prefix,
                                                  string err) {
  (void) err;
  string err2(tmp("err"));
  string eq(" := ");
  if(!declare) {
    eq = " = ";
  }
  out <<
    indent() << prefix << eq << "New" << publicize(type_name(tstruct)) << "()" << endl <<
    indent() << err2 << " := " << prefix << ".Read(iprot)" << endl <<
    indent() << "if " << err2 << " != nil { return thrift.NewTProtocolExceptionReadStruct(\"" <<
                         escape_string(prefix + tstruct->get_name()) << "\", " <<
                         err2 << "); }\n";
}
void t_go_generator :: generate_deserialize_struct ( ofstream & out , t_struct * tstruct , bool declare , string prefix , string err ) { ( void ) err ; string err2 ( tmp ( " " ) ) ; string eq ( " " ) ; if ( ! declare ) { eq = " " ; } out << indent ( ) << prefix << eq << " " << publicize ( type_name ( tstruct ) ) << " " << endl << indent ( ) << err2 << " " << prefix << " " << endl << indent ( ) << " " << err2 << " \" " << escape_string ( prefix + tstruct -> get_name ( ) ) << " \" " << err2 << " \n " ; }
Generates an unserializer for a struct, calling read()
Generates an unserializer for a struct calling read ()