This commit is contained in:
cdle
2021-09-26 17:40:25 +08:00
parent 452d197871
commit bbdd1a514c
+2 -8
View File
@@ -2,10 +2,8 @@ package core
import ( import (
"bufio" "bufio"
"fmt"
"os" "os"
"regexp" "regexp"
"strings"
"time" "time"
) )
@@ -25,12 +23,8 @@ func init() {
scanner := bufio.NewScanner(file) scanner := bufio.NewScanner(file)
for scanner.Scan() { for scanner.Scan() {
line := scanner.Text() line := scanner.Text()
fmt.Println(line, "---") if v := regexp.MustCompile(`^\s*set\s+(\S+)\s+(\S+)\s+(\S+)`).FindStringSubmatch(line); len(v) > 0 {
if regexp.MustCompile(`^\s*set`).MatchString(line) { Bucket(v[1]).Set(v[2], v[3])
fmt.Println(line, "+++")
Senders <- &Faker{
Message: strings.Trim(line, " "),
}
} }
} }
file.Close() file.Close()