Skip to content

Commit

Permalink
style: run gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
wdvxdr1123 committed Dec 29, 2021
1 parent 18487d6 commit b98f75c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ linters:
- errcheck
- exportloopref
- exhaustive
- bidichk
#- funlen
#- goconst
- gocritic
Expand Down
1 change: 0 additions & 1 deletion coolq/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions internal/btree/btree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion internal/btree/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions modules/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b98f75c

Please sign in to comment.