Skip to content

Commit

Permalink
golinter
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Jul 28, 2021
1 parent fbe2f7e commit 602d8dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions testkit/asynctestkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ import (
"go.uber.org/atomic"
)

var asyncTestKitIdGenerator atomic.Uint64
var asyncTestKitIDGenerator atomic.Uint64

// AsyncTestKit is a utility to run sql concurrently.
type AsyncTestKit struct {
require *require.Assertions
assert *assert.Assertions
Expand All @@ -53,7 +54,7 @@ func (tk *AsyncTestKit) OpenSession(ctx context.Context, db string) context.Cont
if tryRetrieveSession(ctx) == nil {
se, err := session.CreateSession4Test(tk.store)
tk.require.NoError(err)
se.SetConnectionID(asyncTestKitIdGenerator.Inc())
se.SetConnectionID(asyncTestKitIDGenerator.Inc())
ctx = context.WithValue(ctx, sessionKey, se)
}
tk.MustExec(ctx, fmt.Sprintf("use %s", db))
Expand Down
4 changes: 2 additions & 2 deletions testkit/testkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"go.uber.org/atomic"
)

var testKitIdGenerator atomic.Uint64
var testKitIDGenerator atomic.Uint64

// TestKit is a utility to run sql test.
type TestKit struct {
Expand Down Expand Up @@ -140,6 +140,6 @@ func (tk *TestKit) Exec(sql string, args ...interface{}) (sqlexec.RecordSet, err
func newSession(t *testing.T, store kv.Storage) session.Session {
se, err := session.CreateSession4Test(store)
require.Nil(t, err)
se.SetConnectionID(testKitIdGenerator.Inc())
se.SetConnectionID(testKitIDGenerator.Inc())
return se
}

0 comments on commit 602d8dc

Please sign in to comment.