MCPcopy
hub / github.com/go-playground/validator / Error

Method Error

errors.go:42–51  ·  view source on GitHub ↗

Error is intended for use in development + debugging and not intended to be a production error message. It allows ValidationErrors to subscribe to the Error interface. All information to create an error message specific to your application is contained within the FieldError found within the Validati

()

Source from the content-addressed store, hash-verified

40// All information to create an error message specific to your application is contained within
41// the FieldError found within the ValidationErrors array
42func (ve ValidationErrors) Error() string {
43 buff := bytes.NewBufferString("")
44
45 for i := 0; i < len(ve); i++ {
46 buff.WriteString(ve[i].Error())
47 buff.WriteString("\n")
48 }
49
50 return strings.TrimSpace(buff.String())
51}
52
53// Translate translates all of the ValidationErrors
54func (ve ValidationErrors) Translate(ut ut.Translator) ValidationErrorsTranslations {

Callers

nothing calls this directly

Calls 2

ErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected