Documentation ¶
Overview ¶
The validator plugin generates a Validate method for each message. By default, if none of the message's fields are annotated with the gogo validator annotation, it returns a nil. In case some of the fields are annotated, the Validate function returns nil upon sucessful validation, or an error describing why the validation failed. The Validate method is called recursively for all submessage of the message.
TODO(michal): ADD COMMENTS.
Equal is enabled using the following extensions:
- equal
- equal_all
While VerboseEqual is enable dusing the following extensions:
- verbose_equal
- verbose_equal_all
The equal plugin also generates a test given it is enabled using one of the following extensions:
- testgen
- testgen_all
Let us look at:
github.com/gogo/protobuf/test/example/example.proto
Btw all the output can be seen at:
github.com/gogo/protobuf/test/example/*
The following message:
given to the equal plugin, will generate the following code:
and the following test code:
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.