1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-06-18 21:45:04 +08:00

style: run gofumpt

This commit is contained in:
wdvxdr 2021-12-29 14:04:51 +08:00
parent 18487d6353
commit b98f75ccab
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
6 changed files with 10 additions and 8 deletions

View File

@ -28,6 +28,7 @@ linters:
- errcheck
- exportloopref
- exhaustive
- bidichk
#- funlen
#- goconst
- gocritic

View File

@ -542,7 +542,6 @@ func (bot *CQBot) InsertGuildChannelMessage(m *message.GuildChannelMessage) stri
// Release 释放Bot实例
func (bot *CQBot) Release() {
}
func (bot *CQBot) dispatchEventMessage(m global.MSG) {

View File

@ -28,15 +28,15 @@ func TestBtree(t *testing.T) {
bt, err := Create(f)
assert2.NoError(t, err)
var tests = []string{
tests := []string{
"hello world",
"123",
"We are met on a great battle-field of that war.",
"Abraham Lincoln, November 19, 1863, Gettysburg, Pennsylvania",
}
var sha = make([]*byte, len(tests))
sha := make([]*byte, len(tests))
for i, tt := range tests {
var hash = sha1.New()
hash := sha1.New()
hash.Write([]byte(tt))
sha[i] = &hash.Sum(nil)[0]
bt.Insert(sha[i], []byte(tt))

View File

@ -45,7 +45,7 @@ func resethash(sha1 *byte) {
// reading table
func read32(r io.Reader) (int32, error) {
var b = make([]byte, 4)
b := make([]byte, 4)
_, err := r.Read(b)
if err != nil {
return 0, err

View File

@ -66,7 +66,7 @@ func Init() {
}
}
var open = func(typ string, cache *Cache) {
open := func(typ string, cache *Cache) {
file := conf[typ]
if file == "" {
file = fmt.Sprintf("data/%s.db", typ)

View File

@ -141,8 +141,10 @@ func Parse(path string) *Config {
return config
}
var serverconfs []*Server
var mu sync.Mutex
var (
serverconfs []*Server
mu sync.Mutex
)
// AddServer 添加该服务的简介和默认配置
func AddServer(s *Server) {