StructExcept validates all fields except the ones passed in. Fields may be provided in a namespaced fashion relative to the struct provided i.e. NestedStruct.Field or NestedArrayField[0].Struct.Name It returns InvalidValidationError for bad values passed in and nil or ValidationErrors as error othe
(s interface{}, fields ...string)
| 521 | // It returns InvalidValidationError for bad values passed in and nil or ValidationErrors as error otherwise. |
| 522 | // You will need to assert the error if it's not nil eg. err.(validator.ValidationErrors) to access the array of errors. |
| 523 | func (v *Validate) StructExcept(s interface{}, fields ...string) error { |
| 524 | return v.StructExceptCtx(context.Background(), s, fields...) |
| 525 | } |
| 526 | |
| 527 | // StructExceptCtx validates all fields except the ones passed in and allows passing of contextual |
| 528 | // validation information via context.Context |