remove empty

This commit is contained in:
zhiqiang feng
2020-12-28 16:46:25 +08:00
parent 68069dec34
commit fd41bf4698
+7
View File
@@ -31,6 +31,7 @@ func check() {
if len(telegram) > 0 {
// Log.Info("telegram ", zap.String("text", telegram))
telegram = removeEmpty(telegram) + "\n"
RawLog.Write([]byte(telegram))
buffer = nil
InsertTelegram(telegram)
@@ -38,3 +39,9 @@ func check() {
}
}
func removeEmpty(s string) string {
regex, _ := regexp.Compile("\n\n")
s = regex.ReplaceAllString(s, "\n")
return s
}