From ece68dae9b950f7f62a8eebc6d2ed208b444c9b4 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, 4 Mar 2024 15:38:26 +0900 Subject: [PATCH] chore(revive): make lint happy --- go.mod | 2 +- plugin/bilibili/bilibilimodel.go | 2 +- plugin/guessmusic/struct.go | 4 ++-- plugin/manager/timer/sleep.go | 2 +- plugin/steam/listenter.go | 10 +++++----- plugin/thesaurus/chat.go | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index ef5416dd63..41363a1f6d 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,6 @@ require ( github.com/fumiama/go-base16384 v1.7.0 github.com/fumiama/go-registry v0.2.6 github.com/fumiama/gotracemoe v0.0.3 - github.com/fumiama/imgsz v0.0.2 github.com/fumiama/jieba v0.0.0-20221203025406-36c17a10b565 github.com/fumiama/unibase2n v0.0.0-20221020155353-02876e777430 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 @@ -57,6 +56,7 @@ require ( github.com/faiface/beep v1.1.0 // indirect github.com/fumiama/go-simple-protobuf v0.1.0 // indirect github.com/fumiama/gofastTEA v0.0.10 // indirect + github.com/fumiama/imgsz v0.0.2 // indirect github.com/gabriel-vasile/mimetype v1.0.4 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect diff --git a/plugin/bilibili/bilibilimodel.go b/plugin/bilibili/bilibilimodel.go index 3fce1d01b1..70397b63d8 100644 --- a/plugin/bilibili/bilibilimodel.go +++ b/plugin/bilibili/bilibilimodel.go @@ -75,7 +75,7 @@ func updateVup() error { if err != nil { return err } - gjson.Get(binary.BytesToString(data), "@this").ForEach(func(key, value gjson.Result) bool { + gjson.Get(binary.BytesToString(data), "@this").ForEach(func(_, value gjson.Result) bool { mid := value.Get("mid").Int() uname := value.Get("uname").String() roomid := value.Get("roomid").Int() diff --git a/plugin/guessmusic/struct.go b/plugin/guessmusic/struct.go index cd4532ca3f..7e9d788cb4 100644 --- a/plugin/guessmusic/struct.go +++ b/plugin/guessmusic/struct.go @@ -241,9 +241,9 @@ type listInfoOfAPI struct { PublishTime int64 `json:"publishTime"` Tns []string `json:"tns,omitempty"` } `json:"tracks"` - VideoIds interface{} `json:"videoIds"` + VideoIDs interface{} `json:"videoIds"` Videos interface{} `json:"videos"` - TrackIds []struct { + TrackIDs []struct { ID int `json:"id"` V int `json:"v"` T int `json:"t"` diff --git a/plugin/manager/timer/sleep.go b/plugin/manager/timer/sleep.go index a6aae76378..e3652909ed 100644 --- a/plugin/manager/timer/sleep.go +++ b/plugin/manager/timer/sleep.go @@ -155,7 +155,7 @@ func (t *Timer) judgeHM() { if t.SelfID != 0 { t.sendmsg(t.GrpID, zero.GetBot(t.SelfID)) } else { - zero.RangeBot(func(id int64, ctx *zero.Ctx) (_ bool) { + zero.RangeBot(func(_ int64, ctx *zero.Ctx) (_ bool) { t.sendmsg(t.GrpID, ctx) return }) diff --git a/plugin/steam/listenter.go b/plugin/steam/listenter.go index 25032f983d..25c2c7c7af 100644 --- a/plugin/steam/listenter.go +++ b/plugin/steam/listenter.go @@ -57,14 +57,14 @@ func init() { return } // 收集这波用户的streamId,然后查当前的状态,并建立信息映射表 - streamIds := make([]string, len(infos)) + streamIDs := make([]string, len(infos)) localPlayerMap := make(map[int64]*player) for i := 0; i < len(infos); i++ { - streamIds[i] = strconv.FormatInt(infos[i].SteamID, 10) + streamIDs[i] = strconv.FormatInt(infos[i].SteamID, 10) localPlayerMap[infos[i].SteamID] = infos[i] } // 将所有用户状态查一遍 - playerStatus, err := getPlayerStatus(streamIds...) + playerStatus, err := getPlayerStatus(streamIDs...) if err != nil { // 出错就发消息 ctx.SendPrivateMessage(su, message.Text("[steam] ERROR: ", err)) @@ -117,11 +117,11 @@ func init() { } // getPlayerStatus 获取用户状态 -func getPlayerStatus(streamIds ...string) ([]*player, error) { +func getPlayerStatus(streamIDs ...string) ([]*player, error) { players := make([]*player, 0) // 拼接请求地址 apiKeyMu.Lock() - url := fmt.Sprintf(apiurl+statusurl, apiKey, strings.Join(streamIds, ",")) + url := fmt.Sprintf(apiurl+statusurl, apiKey, strings.Join(streamIDs, ",")) apiKeyMu.Unlock() // 拉取并解析数据 data, err := web.GetData(url) diff --git a/plugin/thesaurus/chat.go b/plugin/thesaurus/chat.go index 99d0f84916..6fc9303823 100644 --- a/plugin/thesaurus/chat.go +++ b/plugin/thesaurus/chat.go @@ -178,7 +178,7 @@ func init() { engine.OnMessage(canmatch(tKAWA), match(chatListK, seg)). SetBlock(false). Handle(randreply(sm.K)) - engine.OnMessage(canmatch(tALPACA), func(ctx *zero.Ctx) bool { + engine.OnMessage(canmatch(tALPACA), func(_ *zero.Ctx) bool { return alpacapiurl != "" && alpacatoken != "" }).SetBlock(false).Handle(func(ctx *zero.Ctx) { msg := ctx.ExtractPlainText()