(reason string)
| 47 | } |
| 48 | |
| 49 | func (e *FieldError[T]) joinReason(reason string) { |
| 50 | if reason == "" { |
| 51 | return |
| 52 | } |
| 53 | |
| 54 | if e.Reason == "" { |
| 55 | e.Reason = reason |
| 56 | } else { |
| 57 | e.Reason += ", " + reason |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // Func accepts a variadic number of functions which accept the value of the field |
| 62 | // and return a string message if the value is invalid. |