refactor: optimize error message concatenation in default_validator (#4685)

This commit is contained in:
wanghaolong613 2026-06-02 21:45:58 +08:00 committed by GitHub
parent 5f4f964325
commit c79f5d466e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,10 @@ func (err SliceValidationError) Error() string {
if b.Len() > 0 {
b.WriteString("\n")
}
b.WriteString("[" + strconv.Itoa(i) + "]: " + err[i].Error())
b.WriteString("[")
b.WriteString(strconv.Itoa(i))
b.WriteString("]: ")
b.WriteString(err[i].Error())
}
}
return b.String()