1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 19:43:49 +08:00

fix: golangci-lint ineffassign

This commit is contained in:
Ink-33 2021-01-17 02:16:29 +08:00
parent 468befb0fd
commit 1d9f719d13
No known key found for this signature in database
GPG Key ID: 5D8B1D036EFB0D2E
2 changed files with 5 additions and 2 deletions

View File

@ -132,7 +132,7 @@ func ToArrayMessage(e []message.IMessageElement, code int64, raw ...bool) (r []M
})
}
for _, elem := range e {
m := MSG{}
var m MSG
switch o := elem.(type) {
case *message.TextElement:
m = MSG{
@ -811,6 +811,9 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (m interf
}
var header = make([]byte, 4)
_, err = video.Read(header)
if err != nil {
return nil, err
}
if !bytes.Equal(header, []byte{0x66, 0x74, 0x79, 0x70}) { // check file header ftyp
_, _ = video.Seek(0, io.SeekStart)
hash, _ := utils.ComputeMd5AndLength(video)

View File

@ -516,7 +516,7 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
return bot.CQGetGroupHonorInfo(p.Get("group_id").Int(), p.Get("type").Str)
},
"set_restart": func(c *coolq.CQBot, p gjson.Result) coolq.MSG {
var delay int64 = 0
var delay int64
delay = p.Get("delay").Int()
if delay < 0 {
delay = 0