fishy commented on a change in pull request #2307:
URL: https://github.com/apache/thrift/pull/2307#discussion_r560364860



##########
File path: compiler/cpp/src/thrift/generate/t_go_generator.cc
##########
@@ -1847,6 +1860,56 @@ void t_go_generator::generate_go_struct_writer(ostream& 
out,
   }
 }
 
+void t_go_generator::generate_go_struct_deepequal(ostream& out,
+                                               t_struct* tstruct,

Review comment:
       nit: I'm not sure what's the coding style for compiler c++ code but this 
indentation looks weird.

##########
File path: compiler/cpp/src/thrift/generate/t_go_generator.cc
##########
@@ -152,6 +152,10 @@ class t_go_generator : public t_generator {
                                  const string& tstruct_name,
                                  bool is_result = false,
                                  bool uses_countsetfields = false);
+  void generate_go_struct_deepequal(std::ostream& out,

Review comment:
       Can we rename all `*deepequal*` into `*equals*`? I don't think it's 
accurate to call them "deepequal".

##########
File path: compiler/cpp/src/thrift/generate/t_go_generator.cc
##########
@@ -1847,6 +1860,56 @@ void t_go_generator::generate_go_struct_writer(ostream& 
out,
   }
 }
 
+void t_go_generator::generate_go_struct_deepequal(ostream& out,
+                                               t_struct* tstruct,
+                                               const string& tstruct_name,
+                                               bool is_args_or_result) {
+  if (is_args_or_result) {
+    return;
+  }
+  string name(tstruct->get_name());
+  const vector<t_field*>& fields = tstruct->get_sorted_members();
+  vector<t_field*>::const_iterator f_iter;
+  indent(out) << "func (p *" << tstruct_name << ") " << deepequal_method_name_ 
<< "(other *"
+              << tstruct_name << ") bool {" << endl;
+  indent_up();
+
+  string field_name;
+  string publicize_field_name;
+  int32_t field_id = -1;

Review comment:
       this is unused and it will cause certain compilers to fail:
   
   ```
   src/thrift/generate/t_go_generator.cc:1879:11: error: unused variable 
‘field_id’ [-Werror=unused-variable]
    1879 |   int32_t field_id = -1;
         |           ^~~~~~~~
   cc1plus: all warnings being treated as errors
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to