You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that, if Bar has no validation rules, all this code is pointless.
It would be ideal if instead we generated, at least in the case of messages that we know are in the same package, and that therefore are being generated together:
This way if (*Bar).Validate() is just return nil (i.e. there are no validation rules), the compiler can completely remove the whole if (or it can potentially inline the call, if there's a single rule).
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Currently the go generator generates something like this for embedded messages:
The problem is that, if Bar has no validation rules, all this code is pointless.
It would be ideal if instead we generated, at least in the case of messages that we know are in the same package, and that therefore are being generated together:
This way if
(*Bar).Validate()
is justreturn nil
(i.e. there are no validation rules), the compiler can completely remove the wholeif
(or it can potentially inline the call, if there's a single rule).The text was updated successfully, but these errors were encountered: