Skip to content

Commit

Permalink
fix golnagci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
aceld committed Aug 15, 2024
1 parent b066c94 commit faf6c5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion znet/acceptdelay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package znet

import (
"fmt"
"os"
"testing"
"time"

Expand Down Expand Up @@ -32,6 +33,7 @@ func TestDelay(t *testing.T) {

func TestMain(m *testing.M) {
setup()
m.Run()
code := m.Run()
teardown()
os.Exit(code)
}
6 changes: 2 additions & 4 deletions znet/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import (
"sync/atomic"
"time"

"github.com/gorilla/websocket"

"github.com/aceld/zinx/zconf"
"github.com/aceld/zinx/ziface"
"github.com/aceld/zinx/zinterceptor"
"github.com/aceld/zinx/zlog"
"github.com/aceld/zinx/zpack"

"github.com/aceld/zinx/ziface"
"github.com/gorilla/websocket"
)

// Connection TCP connection module
Expand Down Expand Up @@ -547,7 +546,6 @@ func (c *Connection) isClosed() bool {
return c.ctx == nil || c.ctx.Err() != nil
}


func (c *Connection) setStartWriterFlag() bool {
return atomic.CompareAndSwapInt32(&c.startWriterFlag, 0, 1)
}
Expand Down
2 changes: 1 addition & 1 deletion zutils/shard_lock_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func TestFnv32(t *testing.T) {
hasher := fnv.New32()
_, err := hasher.Write(key)
if err != nil {
t.Errorf(err.Error())
t.Errorf("%v", err)
}
if (&Fnv32Hash{}).Sum(string(key)) != hasher.Sum32() {
t.Errorf("Bundled fnv32 produced %d, expected result from hash/fnv32 is %d", (&Fnv32Hash{}).Sum(string(key)), hasher.Sum32())
Expand Down

0 comments on commit faf6c5c

Please sign in to comment.