Jens-G commented on code in PR #2469:
URL: https://github.com/apache/thrift/pull/2469#discussion_r970140254


##########
compiler/cpp/src/thrift/generate/t_go_generator.cc:
##########
@@ -1384,6 +1121,14 @@ void t_go_generator::generate_xception(t_struct* 
txception) {
  */
 void t_go_generator::generate_go_struct(t_struct* tstruct, bool is_exception) {
   generate_go_struct_definition(f_types_, tstruct, is_exception);
+  // generate Validate function
+  std::string tstruct_name(publicize(tstruct->get_name(), false));
+  f_types_ << "func (p *" << tstruct_name << ") Validate() error {" << endl;
+  indent_up();
+  go_validator_generator(this).generate_struct_validator(f_types_, tstruct);

Review Comment:
   I know I'm late to the party, but this line causes LNK2019 in Visual Studio 
2022. Any idea why? I am staring at this for quite a while now and just can't 
find it. 
   
   ```
   Code wird generiert...
   Debug\go_validator_generator.obj : warning LNK4042: Objekt mehrmals 
angegeben; zusätzliche Objekte werden ignoriert.
   t_go_generator.obj : error LNK2019: Verweis auf nicht aufgelöstes externes 
Symbol ""public: void __thiscall 
go_validator_generator::generate_struct_validator(class 
std::basic_ostream<char,struct std::char_traits<char> > &,class t_struct *)" 
(?generate_struct_validator@go_validator_generator@@QAEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@PAVt_struct@@@Z)"
 in Funktion ""public: void __thiscall t_go_generator::generate_go_struct(class 
t_struct *,bool)" (?generate_go_struct@t_go_generator@@QAEXPAVt_struct@@_N@Z)".
   thrift.exe : fatal error LNK1120: 1 nicht aufgelöste Externe
   
   ```
   
   
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to