I have a field named ‘source’, i need make it required if another field ‘type’ = 2 or ‘type’ = 3
how should i write it ?
// @gotags: json:"source" validate:"required_if=Type 2 | required_if=Type 3"
string Source = 4;
This returns error on validation.
I try even "required_if=Type 2|required_if=Type 3"
and "required_if=Type 2| required_if=Type 3"
and "required_if=Type 2|required_if=Type 3"
and "required_if=Type 2 |required_if=Type 3"
and "required_if=Type 2|3"
none of them works.
New contributor
ITB Test is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.