This commit is contained in:
1 parent
161bc3a345
commit
bb4ac4d5f5
20 files changed
+765
-132
No files matched your search
@@ -0,0 +1,12 @@
|
||||
package logpolicy
|
||||
|
||||
import "strings"
|
||||
|
||||
// EmptyMessage 仅识别空白和纯装饰线,不猜测业务文案、状态或未知格式的价值。
|
||||
func EmptyMessage(message string) bool {
|
||||
message = strings.TrimSpace(strings.ReplaceAll(message, "\x00", ""))
|
||||
if message == "" {
|
||||
return true
|
||||
}
|
||||
return len([]rune(message)) >= 3 && strings.Trim(message, "*-=─━_~ \t\r\n") == ""
|
||||
}
|
||||
Reference in new issue
Block a user