forked from mtusi2026/mtusi2026lab3
внес правки
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
@@ -390,12 +391,16 @@ func validMessageText(s string) bool {
|
||||
if n == 0 || n > 4000 {
|
||||
return false
|
||||
}
|
||||
hasContent := false
|
||||
for _, r := range s {
|
||||
if r != ' ' && r != '\t' && r != '\n' && r != '\r' {
|
||||
return true
|
||||
if r == 0 {
|
||||
return false
|
||||
}
|
||||
if !unicode.IsSpace(r) {
|
||||
hasContent = true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return hasContent
|
||||
}
|
||||
|
||||
var ErrSessionNotFound = errors.New("session not found or expired")
|
||||
|
||||
Reference in New Issue
Block a user