Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiang-Red committed Aug 20, 2024
1 parent e6b7826 commit 5f0682f
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
6 changes: 3 additions & 3 deletions control/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func init() {
}
condition := strings.Contains(ctx.Event.RawMessage, "启用") || strings.Contains(ctx.Event.RawMessage, "enable")
if condition {
managers.ForEach(func(key string, manager *ctrl.Control[*zero.Ctx]) bool {
managers.ForEach(func(_ string, manager *ctrl.Control[*zero.Ctx]) bool {
if manager.Options.DisableOnDefault == condition {
return true
}
Expand All @@ -176,7 +176,7 @@ func init() {
})
ctx.SendChain(message.Text("此处启用所有插件成功"))
} else {
managers.ForEach(func(key string, manager *ctrl.Control[*zero.Ctx]) bool {
managers.ForEach(func(_ string, manager *ctrl.Control[*zero.Ctx]) bool {
manager.Disable(grp)
return true
})
Expand Down Expand Up @@ -234,7 +234,7 @@ func init() {
argsparsed := make([]int64, 0, len(args))
var uid int64
var err error
haspermission := zero.GroupHigherPermission(func(ctx *zero.Ctx) int64 { return uid })
haspermission := zero.GroupHigherPermission(func(_ *zero.Ctx) int64 { return uid })
for _, usr := range args[1:] {
uid, err = strconv.ParseInt(usr, 10, 64)
if err == nil && haspermission(ctx) {
Expand Down
5 changes: 4 additions & 1 deletion control/servicepic.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ func renderserverlistlogo() (img image.Image, err error) {
mask := canvas.AsMask()

stroked := gg.NewContext(w, h)
stroked.SetMask(mask)
err = stroked.SetMask(mask)
if err != nil {
return
}
stroked.SetRGBA255(255, 255, 255, 255)
stroked.DrawRectangle(0, 0, float64(stroked.W()), float64(stroked.H()))
stroked.Fill()
Expand Down
2 changes: 1 addition & 1 deletion control/web/controller/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
// 存储请求事件,flag作为键,一个request对象作为值
requestData syncx.Map[string, *zero.Event]
upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
CheckOrigin: func(_ *http.Request) bool {
return true
},
}
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ go 1.20
require (
github.com/FloatTech/ZeroBot-Plugin-Webui v1.0.1-0.20230412164529-cfe878675931
github.com/FloatTech/floatbox v0.0.0-20240505082030-226ec6713e14
github.com/FloatTech/gg v1.1.2
github.com/FloatTech/gg v1.1.3
github.com/FloatTech/imgfactory v0.2.2-0.20230315152233-49741fc994f9
github.com/FloatTech/rendercard v0.0.10-0.20230223064326-45d29fa4ede9
github.com/FloatTech/sqlite v1.6.3
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1
github.com/FloatTech/zbpctrl v1.6.1
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7
github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5
github.com/disintegration/imaging v1.6.2
github.com/fumiama/cron v1.3.0
github.com/fumiama/go-base16384 v1.7.0
github.com/fumiama/go-registry v0.2.6
Expand All @@ -31,9 +29,11 @@ require (
)

require (
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/ericpauley/go-quantize v0.0.0-20200331213906-ae555eb2afa4 // indirect
github.com/fumiama/go-simple-protobuf v0.1.0 // indirect
github.com/fumiama/gofastTEA v0.0.10 // indirect
Expand Down Expand Up @@ -62,7 +62,7 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/image v0.3.0 // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ github.com/FloatTech/ZeroBot-Plugin-Webui v1.0.1-0.20230412164529-cfe878675931 h
github.com/FloatTech/ZeroBot-Plugin-Webui v1.0.1-0.20230412164529-cfe878675931/go.mod h1:Se2A9vnC4eSYF7vR2LNSayV7rvbFcpgVs1ZN4sEYMyg=
github.com/FloatTech/floatbox v0.0.0-20240505082030-226ec6713e14 h1:8O0Iq9MnKsKowltY9txhOqcJdmGTjxHPQ4gEYzbJc9A=
github.com/FloatTech/floatbox v0.0.0-20240505082030-226ec6713e14/go.mod h1:OzGLhvmtz1TKIdGaJDd8pQumvD36UqK+dWsiCISmzQQ=
github.com/FloatTech/gg v1.1.2 h1:YolgOYg3uDHc1+g0bLtt6QuRA/pvLn+b9IBCIhOOX88=
github.com/FloatTech/gg v1.1.2/go.mod h1:uzPzAeT35egARdRuu+1oyjU3CmTwCceoq3Vvje7LpcI=
github.com/FloatTech/gg v1.1.3 h1:+GlL02lTKsxJQr4WCuNwVxC1/eBZrCvypCIBtxuOFb4=
github.com/FloatTech/gg v1.1.3/go.mod h1:/9oLP54CMfq4r+71XL26uaFTJ1uL1boAyX67680/1HE=
github.com/FloatTech/imgfactory v0.2.2-0.20230315152233-49741fc994f9 h1:IzZLuM/fgKclyMaU/Qb1qlLdGrs2FTietkqOWhh07Gw=
github.com/FloatTech/imgfactory v0.2.2-0.20230315152233-49741fc994f9/go.mod h1:el5hGpj1C1bDRxcTXYRwEivDCr40zZeJpcrLrB1fajs=
github.com/FloatTech/rendercard v0.0.10-0.20230223064326-45d29fa4ede9 h1:hffajvmQFfP68U6wUwHemPuuwCUoss+SEFfoLYwbGwE=
Expand Down Expand Up @@ -184,8 +184,8 @@ golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.3.0 h1:HTDXbdK9bjfSWkPzDJIw89W8CAtfFGduujWs33NLLsg=
golang.org/x/image v0.3.0/go.mod h1:fXd9211C/0VTlYuAcOhW8dY/RtEJqODXOWBDpmYBf+A=
golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
Expand Down Expand Up @@ -229,7 +229,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
2 changes: 2 additions & 0 deletions img/pool/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import (
zero "github.com/wdvxdr1123/ZeroBot"
)

// NTImage ...
type NTImage nturl

// NewNTImage ...
func NewNTImage(u string) (nti NTImage, err error) {
subs := ntcachere.FindStringSubmatch(u)
if len(subs) != 3 {
Expand Down
2 changes: 2 additions & 0 deletions img/pool/nt.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const (
var ntcachere = regexp.MustCompile(`^https://multimedia.nt.qq.com.cn/download\?appid=1407&fileid=([0-9a-zA-Z_-]+)&spec=0&rkey=([0-9a-zA-Z_-]+)$`)

var (
// ErrInvalidNTURL ...
ErrInvalidNTURL = errors.New("invalid nt url")
// ErrInvalidNTRaw ...
ErrInvalidNTRaw = errors.New("invalid nt raw")
)

Expand Down
2 changes: 1 addition & 1 deletion img/text/font.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
QiantuXiaotuFontFile = FontPath + "QiantuXiaotuTi.ttf"
// GNUUnifontFontFile GNU Unifont https://unifoundry.com/unifont/index.html
GNUUnifontFontFile = FontPath + "unifont-15.0.06.ttf"
// AiralFontFile ...
// ArialFontFile ...
ArialFontFile = FontPath + "arial.ttf"
// TorusFontFile ...
TorusFontFile = FontPath + "Torus-Regular.otf"
Expand Down
2 changes: 1 addition & 1 deletion job/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type Job struct {
// List 任务列表
func List() (jobList []Job, err error) {
jobList = make([]Job, 0, 16)
zero.RangeBot(func(id int64, ctx *zero.Ctx) bool {
zero.RangeBot(func(id int64, _ *zero.Ctx) bool {
c := &cmd{}
ids := strconv.FormatInt(id, 36)
_ = db.FindFor(ids, c, "", func() error {
Expand Down

0 comments on commit 5f0682f

Please sign in to comment.