WrapFieldError wraps the given field.Error adding the given field.Path as root of the Field.
(err *field.Error, path *field.Path)
| 10 | |
| 11 | // WrapFieldError wraps the given field.Error adding the given field.Path as root of the Field. |
| 12 | func WrapFieldError(err *field.Error, path *field.Path) *field.Error { |
| 13 | if err == nil { |
| 14 | return nil |
| 15 | } |
| 16 | if path == nil { |
| 17 | return err |
| 18 | } |
| 19 | err.Field = path.Child(err.Field).String() |
| 20 | return err |
| 21 | } |
| 22 | |
| 23 | // WrapFieldErrorList wraps the given field.ErrorList adding the given field.Path as root of the Field. |
| 24 | func WrapFieldErrorList(errs field.ErrorList, path *field.Path) field.ErrorList { |
no outgoing calls
no test coverage detected