This commit is contained in:
Nurlygayanova Ekaterina
2026-11-05 17:56:30 +03:00
parent 0ab3a341aa
commit 1c95e2e68e
178 changed files with 21135 additions and 17 deletions
+13
View File
@@ -0,0 +1,13 @@
package validate
import "fmt"
func MessageText(s string) error {
if !notOnlyWhitespace(s) {
return newError("text", "must not be empty or whitespace only")
}
if !codePointsBetween(s, MessageTextMinLen, MessageTextMaxLen) {
return newError("text", fmt.Sprintf("length must be in [%d, %d] code points", MessageTextMinLen, MessageTextMaxLen))
}
return nil
}