From de558dc87b031eee20609004a472bacae1242085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:50:35 +0800 Subject: [PATCH] chore: make lint happy --- plugin/manager/timer/parse.go | 6 +++--- plugin/manager/timer/wrap.go | 12 ++++++------ plugin/mcfish/main.go | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugin/manager/timer/parse.go b/plugin/manager/timer/parse.go index 83a296fbf5..585a88edb6 100644 --- a/plugin/manager/timer/parse.go +++ b/plugin/manager/timer/parse.go @@ -96,12 +96,12 @@ func GetFilledTimer(dateStrs []string, botqq, grp int64, matchDateOnly bool) *Ti if len(minuteStr) == 3 { minuteStr = []rune{minuteStr[0], minuteStr[2]} // 去除中间的十 } - min := chineseNum2Int(minuteStr) - if min < -1 || min > 59 { // 分钟非法 + minute := chineseNum2Int(minuteStr) + if minute < -1 || minute > 59 { // 分钟非法 t.Alert = "分钟非法!" return &t } - t.SetMinute(min) + t.SetMinute(minute) if !matchDateOnly { urlStr := dateStrs[5] if urlStr != "" { // 是图片url diff --git a/plugin/manager/timer/wrap.go b/plugin/manager/timer/wrap.go index bb48f29d1b..8c1c42c4fc 100644 --- a/plugin/manager/timer/wrap.go +++ b/plugin/manager/timer/wrap.go @@ -44,10 +44,10 @@ func (t *Timer) Hour() (h int) { } // Minute 6bits -func (t *Timer) Minute() (min int) { - min = int(t.En1Month4Day5Week3Hour5Min6 & 0x00003f) - if min == 0b111111 { - min = -1 +func (t *Timer) Minute() (m int) { + m = int(t.En1Month4Day5Week3Hour5Min6 & 0x00003f) + if m == 0b111111 { + m = -1 } return } @@ -82,6 +82,6 @@ func (t *Timer) SetHour(h int) { } // SetMinute ... -func (t *Timer) SetMinute(min int) { - t.En1Month4Day5Week3Hour5Min6 = (int32(min) & 0x00003f) | (t.En1Month4Day5Week3Hour5Min6 & 0xffffc0) +func (t *Timer) SetMinute(m int) { + t.En1Month4Day5Week3Hour5Min6 = (int32(m) & 0x00003f) | (t.En1Month4Day5Week3Hour5Min6 & 0xffffc0) } diff --git a/plugin/mcfish/main.go b/plugin/mcfish/main.go index 76c27b5fe8..b3ce1a64c9 100644 --- a/plugin/mcfish/main.go +++ b/plugin/mcfish/main.go @@ -208,7 +208,7 @@ func init() { Min: probableList[2], Max: probableList[3], } - min := make(map[string]int, 4) + minMap := make(map[string]int, 4) for _, info := range articlesInfo.ArticleInfo { switch { case info.Type == "pole" || info.Name == "美西螈": @@ -228,10 +228,10 @@ func init() { durationList[info.Name] = info.Durable } probabilities[info.Name] = probabilityLimit{ - Min: min[info.Type], - Max: min[info.Type] + info.Probability, + Min: minMap[info.Type], + Max: minMap[info.Type] + info.Probability, } - min[info.Type] += info.Probability + minMap[info.Type] += info.Probability } // }() }