Merge 1c24d1950da99103741b272a718598e73f628273 into d3ffc9985281dcf4d3bef604cce4e662b1a327a6

This commit is contained in:
Preetham 2026-04-06 06:51:46 +00:00 committed by GitHub
commit 2ee732647f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -71,18 +71,18 @@ var Validator StructValidator = &defaultValidator{}
// These implement the Binding interface and can be used to bind the data // These implement the Binding interface and can be used to bind the data
// present in the request to struct instances. // present in the request to struct instances.
var ( var (
JSON = jsonBinding{} JSON = jsonBinding{}
XML = xmlBinding{} XML = xmlBinding{}
Form = formBinding{} Form = formBinding{}
Query = queryBinding{} Query = queryBinding{}
FormPost = formPostBinding{} FormPost = formPostBinding{}
FormMultipart = formMultipartBinding{} FormMultipart = formMultipartBinding{}
ProtoBuf = protobufBinding{} ProtoBuf = protobufBinding{}
YAML = yamlBinding{} YAML = yamlBinding{}
Uri = uriBinding{} Uri = uriBinding{}
Header = headerBinding{} Header = headerBinding{}
TOML = tomlBinding{} TOML = tomlBinding{}
Plain = plainBinding{} Plain = plainBinding{}
BSON BindingBody = bsonBinding{} BSON BindingBody = bsonBinding{}
) )

View File

@ -27,12 +27,12 @@ func (err SliceValidationError) Error() string {
} }
var b strings.Builder var b strings.Builder
for i := range len(err) { for i, e := range err {
if err[i] != nil { if e != nil {
if b.Len() > 0 { if b.Len() > 0 {
b.WriteString("\n") b.WriteString("\n")
} }
b.WriteString("[" + strconv.Itoa(i) + "]: " + err[i].Error()) b.WriteString("[" + strconv.Itoa(i) + "]: " + e.Error())
} }
} }
return b.String() return b.String()