Polish combat scene validation
This commit is contained in:
@@ -196,13 +196,10 @@ func validateExplanation(value string) (string, error) {
|
||||
if trimmed == "" {
|
||||
return "", validatorErrorf("validator explanation must not be blank")
|
||||
}
|
||||
if trimmed != value {
|
||||
return "", validatorErrorf("validator explanation must be trimmed")
|
||||
}
|
||||
if utf8.RuneCountInString(value) > maximumExplanationRunes {
|
||||
if utf8.RuneCountInString(trimmed) > maximumExplanationRunes {
|
||||
return "", validatorErrorf("validator explanation exceeds %d Unicode code points", maximumExplanationRunes)
|
||||
}
|
||||
return value, nil
|
||||
return trimmed, nil
|
||||
}
|
||||
|
||||
func Spec() pipeline.ValidatorSpec {
|
||||
|
||||
Reference in New Issue
Block a user