compiler/cpp/src/generate/t_go_generator.cc
/**
 * Renders an interface function signature of the form 'type name(args)'
 *
 * @param tfunction Function definition
 * @return String of rendered function definition
 */
Renders an interface function signature of the form 'type name(args)'
@param tfunction Function definition
@return String of rendered function definition
Renders an interface function signature of the form ' type name ( args ) ' @param tfunction Function definition @return String of rendered function definition
string t_go_generator::function_signature_if(t_function* tfunction,
                                             string prefix,
                                             bool addOsError) {
  string signature = publicize(prefix + tfunction->get_name()) + "(";
  signature += argument_list(tfunction->get_arglist()) + ") (";
  t_type* ret = tfunction->get_returntype();
  t_struct* exceptions = tfunction->get_xceptions();
  string errs = argument_list(exceptions);
  string retval(tmp("retval"));
  if(!ret->is_void()) {
    signature += retval + " " + type_to_go_type(ret);
    if(addOsError || errs.size()==0) {
      signature += ", ";
    }
  }
  if(errs.size()>0) {
    signature += errs;
    if(addOsError)
      signature += ", ";
  }
  if(addOsError) {
    signature += "err os.Error";
  }
  signature += ")";
  return signature;
}
string t_go_generator :: function_signature_if ( t_function * tfunction , string prefix , bool addOsError ) { string signature = publicize ( prefix + tfunction -> get_name ( ) ) + " " ; signature += argument_list ( tfunction -> get_arglist ( ) ) + " " ; t_type * ret = tfunction -> get_returntype ( ) ; t_struct * exceptions = tfunction -> get_xceptions ( ) ; string errs = argument_list ( exceptions ) ; string retval ( tmp ( " " ) ) ; if ( ! ret -> is_void ( ) ) { signature += retval + " " + type_to_go_type ( ret ) ; if ( addOsError || errs . size ( ) == 0 ) { signature += " " ; } } if ( errs . size ( ) > 0 ) { signature += errs ; if ( addOsError ) signature += " " ; } if ( addOsError ) { signature += " " ; } signature += " " ; return signature ; }
Renders an interface function signature of the form 'type name(args)'
 @param tfunction Function definition
 @return String of rendered function definition
Renders an interface function signature of the form ' type name ( args ) ' @param tfunction Function definition @return String of rendered function definition
// TODO(mcslee): Nitpicky, no ',' if argument_list is empty