Addf adds an error to the validation result at the given path and with the given value, allowing for fmt.Printf-style formatting.
(path *PathBuffer, v any, format string, args ...any)
| 189 | // Addf adds an error to the validation result at the given path and with |
| 190 | // the given value, allowing for fmt.Printf-style formatting. |
| 191 | func (r *ValidateResult) Addf(path *PathBuffer, v any, format string, args ...any) { |
| 192 | r.Errors = append(r.Errors, &ErrorDetail{ |
| 193 | Message: fmt.Sprintf(format, args...), |
| 194 | Location: path.String(), |
| 195 | Value: v, |
| 196 | }) |
| 197 | } |
| 198 | |
| 199 | // Reset the validation error so it can be used again. |
| 200 | func (r *ValidateResult) Reset() { |