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

.github: update golint.yml

This commit is contained in:
wdvxdr 2022-02-08 21:52:54 +08:00
parent d33f17e727
commit b70db344a6
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
4 changed files with 2 additions and 15 deletions

View File

@ -37,4 +37,5 @@ jobs:
if: ${{ github.event.pull_request }} if: ${{ github.event.pull_request }}
uses: reviewdog/action-suggester@v1 uses: reviewdog/action-suggester@v1
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tool_name: golangci-lint tool_name: golangci-lint

View File

@ -414,7 +414,7 @@ func ToMessageContent(e []message.IMessageElement) (r []global.MSG) {
case *message.RedBagElement: case *message.RedBagElement:
m = global.MSG{ m = global.MSG{
"type": "redbag", "type": "redbag",
"data": global.MSG{"title": o.Title, "type": o.MsgType}, "data": global.MSG{"title": o.Title, "type": int(o.MsgType)},
} }
case *message.ForwardElement: case *message.ForwardElement:
m = global.MSG{ m = global.MSG{

View File

@ -5,7 +5,6 @@ import (
"encoding/gob" "encoding/gob"
"path" "path"
"github.com/Mrs4s/MiraiGo/message"
"github.com/Mrs4s/MiraiGo/utils" "github.com/Mrs4s/MiraiGo/utils"
"github.com/Mrs4s/MiraiGo/binary" "github.com/Mrs4s/MiraiGo/binary"
@ -37,7 +36,6 @@ func init() {
gob.Register(db.StoredGroupMessage{}) gob.Register(db.StoredGroupMessage{})
gob.Register(db.StoredPrivateMessage{}) gob.Register(db.StoredPrivateMessage{})
gob.Register(db.StoredGuildChannelMessage{}) gob.Register(db.StoredGuildChannelMessage{})
gob.Register(message.RedBagMessageType(0))
db.Register("leveldb", func(node yaml.Node) db.Database { db.Register("leveldb", func(node yaml.Node) db.Database {
conf := new(config.LevelDBConfig) conf := new(config.LevelDBConfig)

View File

@ -2,7 +2,6 @@ package server
import ( import (
"bytes" "bytes"
"context"
"crypto/hmac" "crypto/hmac"
"crypto/sha1" "crypto/sha1"
"encoding/hex" "encoding/hex"
@ -360,14 +359,3 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) {
c.bot.CQHandleQuickOperation(gjson.Parse(e.JSONString()), gjson.ParseBytes(r)) c.bot.CQHandleQuickOperation(gjson.Parse(e.JSONString()), gjson.ParseBytes(r))
} }
} }
func (s *httpServer) ShutDown() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := s.HTTP.Shutdown(ctx); err != nil {
log.Fatal("http Server Shutdown:", err)
}
<-ctx.Done()
log.Println("timeout of 5 seconds.")
log.Println("http Server exiting")
}