Skip to content

Commit

Permalink
.github: update golint.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wdvxdr1123 committed Feb 8, 2022
1 parent d33f17e commit b70db34
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/golint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
if: ${{ github.event.pull_request }}
uses: reviewdog/action-suggester@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tool_name: golangci-lint
2 changes: 1 addition & 1 deletion coolq/cqcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func ToMessageContent(e []message.IMessageElement) (r []global.MSG) {
case *message.RedBagElement:
m = global.MSG{
"type": "redbag",
"data": global.MSG{"title": o.Title, "type": o.MsgType},
"data": global.MSG{"title": o.Title, "type": int(o.MsgType)},
}
case *message.ForwardElement:
m = global.MSG{
Expand Down
2 changes: 0 additions & 2 deletions db/leveldb/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/gob"
"path"

"github.com/Mrs4s/MiraiGo/message"
"github.com/Mrs4s/MiraiGo/utils"

"github.com/Mrs4s/MiraiGo/binary"
Expand Down Expand Up @@ -37,7 +36,6 @@ func init() {
gob.Register(db.StoredGroupMessage{})
gob.Register(db.StoredPrivateMessage{})
gob.Register(db.StoredGuildChannelMessage{})
gob.Register(message.RedBagMessageType(0))

db.Register("leveldb", func(node yaml.Node) db.Database {
conf := new(config.LevelDBConfig)
Expand Down
12 changes: 0 additions & 12 deletions server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package server

import (
"bytes"
"context"
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
Expand Down Expand Up @@ -360,14 +359,3 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) {
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")
}

0 comments on commit b70db34

Please sign in to comment.