update
This commit is contained in:
+2
-8
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user