From 17e0666ba443f27a578911a6b7d7a3e6557a6a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 3 Aug 2022 23:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/node.go | 2 +- internal/re/regexp_test.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/nodes/node.go b/internal/nodes/node.go index 30c0c05..83503f7 100644 --- a/internal/nodes/node.go +++ b/internal/nodes/node.go @@ -682,7 +682,7 @@ func (this *Node) listenSock() error { if this.sock.IsListening() { reply, err := this.sock.Send(&gosock.Command{Code: "pid"}) if err == nil { - return errors.New("error: the process is already running, pid: " + maps.NewMap(reply.Params).GetString("pid")) + return errors.New("error: the process is already running, pid: " + types.String(maps.NewMap(reply.Params).GetInt("pid"))) } else { return errors.New("error: the process is already running") } diff --git a/internal/re/regexp_test.go b/internal/re/regexp_test.go index 7e7b955..302c6de 100644 --- a/internal/re/regexp_test.go +++ b/internal/re/regexp_test.go @@ -109,6 +109,8 @@ func TestRegexp_ParseKeywords3(t *testing.T) { func BenchmarkRegexp_MatchString(b *testing.B) { var r = re.MustCompile("(?i)(onmouseover|onmousemove|onmousedown|onmouseup|onerror|onload|onclick|ondblclick|onkeydown|onkeyup|onkeypress)(\\s|%09|%0A|(\\+|%20))*(=|%3D)") + b.ResetTimer() + //b.Log("keywords:", r.Keywords()) for i := 0; i < b.N; i++ { r.MatchString("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36") @@ -117,6 +119,8 @@ func BenchmarkRegexp_MatchString(b *testing.B) { func BenchmarkRegexp_MatchString2(b *testing.B) { var r = regexp.MustCompile("(?i)(onmouseover|onmousemove|onmousedown|onmouseup|onerror|onload|onclick|ondblclick|onkeydown|onkeyup|onkeypress)(\\s|%09|%0A|(\\+|%20))*(=|%3D)") + b.ResetTimer() + for i := 0; i < b.N; i++ { r.MatchString("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36") }