ЛР 2: PostgreSQL, сессии в Valkey, кэш истории (трек 1)

This commit is contained in:
Нурлыгаянова Екатерина
2026-10-29 11:29:38 +03:00
parent 65003b6119
commit 1503b5db81
132 changed files with 15114 additions and 20 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
}