From 0f93200c0050947101ac84341218262465462c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kurk=C3=B3=20Mih=C3=A1ly?= Date: Wed, 4 Jul 2018 21:43:58 +0300 Subject: [PATCH] dashboard, log: gosimple --- dashboard/log.go | 4 ++-- log/handler.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/log.go b/dashboard/log.go index d8116826ab..5d852d60a4 100644 --- a/dashboard/log.go +++ b/dashboard/log.go @@ -62,7 +62,7 @@ func (db *Dashboard) handleLogRequest(r *LogsRequest, c *client) { log.Warn("Failed to open logdir", "path", db.logdir, "err", err) return } - re := regexp.MustCompile("\\.log$") + re := regexp.MustCompile(`\.log$`) fileNames := make([]string, 0, len(files)) for _, f := range files { if f.Mode().IsRegular() && re.MatchString(f.Name()) { @@ -155,7 +155,7 @@ func (db *Dashboard) streamLogs() { ) // The log records are always written into the last file in alphabetical order, because of the timestamp. - re := regexp.MustCompile("\\.log$") + re := regexp.MustCompile(`\.log$`) i := len(files) - 1 for i >= 0 && (!files[i].Mode().IsRegular() || !re.MatchString(files[i].Name())) { i-- diff --git a/log/handler.go b/log/handler.go index 2287e8d614..2f01b5dc6f 100644 --- a/log/handler.go +++ b/log/handler.go @@ -142,7 +142,7 @@ func RotatingFileHandler(path string, limit uint, formatter Format) (Handler, er if err != nil { return nil, err } - re := regexp.MustCompile("\\.log$") + re := regexp.MustCompile(`\.log$`) last := len(files) - 1 for last >= 0 && (!files[last].Mode().IsRegular() || !re.MatchString(files[last].Name())) { last--