We should have the ability to integrate other fields into our validation rules.
Suggestion
In the example below, LastName would only be required if FirstName was set.
type Foo struct {
FirstName string `validate:"empty|max(20)"`
LastName string `validate:"FirstName.empty|not_empty,max(20)"`
}
We should have the ability to integrate other fields into our validation rules.
Suggestion
In the example below, LastName would only be required if FirstName was set.