mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
fix: golangci-lint errcheck
This commit is contained in:
parent
1001cefb6f
commit
d16fd6f34d
@ -27,7 +27,10 @@ func EncoderSilk(data []byte) ([]byte, error) {
|
||||
return nil, errors.New("no silk encoder")
|
||||
}
|
||||
h := md5.New()
|
||||
h.Write(data)
|
||||
_, err := h.Write(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tempName := fmt.Sprintf("%x", h.Sum(nil))
|
||||
if silkPath := path.Join("data/cache", tempName+".silk"); PathExists(silkPath) {
|
||||
return ioutil.ReadFile(silkPath)
|
||||
|
2
main.go
2
main.go
@ -487,5 +487,5 @@ func restart(Args []string) {
|
||||
Stdout: os.Stdout,
|
||||
}
|
||||
}
|
||||
cmd.Start()
|
||||
_ = cmd.Start()
|
||||
}
|
||||
|
@ -123,7 +123,11 @@ func (c *httpClient) onBotPushEvent(m coolq.MSG) {
|
||||
}
|
||||
if c.secret != "" {
|
||||
mac := hmac.New(sha1.New, []byte(c.secret))
|
||||
mac.Write([]byte(m.ToJson()))
|
||||
_, err := mac.Write([]byte(m.ToJson()))
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return nil
|
||||
}
|
||||
h["X-Signature"] = "sha1=" + hex.EncodeToString(mac.Sum(nil))
|
||||
}
|
||||
return h
|
||||
|
Loading…
x
Reference in New Issue
Block a user