MCPcopy
hub / github.com/danielgtaylor/huma / Addf

Method Addf

validate.go:191–197  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
191func (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.
200func (r *ValidateResult) Reset() {

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected