Skip to content

Commit

Permalink
Add var-name sub linter in revive (milvus-io#27424)
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Oct 7, 2023
1 parent 5c1abfa commit cd5f03f
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 125 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ linters-settings:
rules:
- name: unused-parameter
disabled: true
- name: var-naming
severity: warning
disabled: false
arguments:
- ["ID"] # Allow list
misspell:
locale: US
gocritic:
Expand Down
10 changes: 5 additions & 5 deletions internal/datacoord/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4167,7 +4167,7 @@ func TestDataCoordServer_UpdateChannelCheckpoint(t *testing.T) {
})
}

var global_test_tikv = tikv.SetupLocalTxn()
var globalTestTikv = tikv.SetupLocalTxn()

func newTestServer(t *testing.T, receiveCh chan any, opts ...Option) *Server {
var err error
Expand All @@ -4188,7 +4188,7 @@ func newTestServer(t *testing.T, receiveCh chan any, opts ...Option) *Server {

svr := CreateServer(context.TODO(), factory)
svr.SetEtcdClient(etcdCli)
svr.SetTiKVClient(global_test_tikv)
svr.SetTiKVClient(globalTestTikv)

svr.dataNodeCreator = func(ctx context.Context, addr string, nodeID int64) (types.DataNodeClient, error) {
return newMockDataNodeClient(0, receiveCh)
Expand Down Expand Up @@ -4242,7 +4242,7 @@ func newTestServerWithMeta(t *testing.T, receiveCh chan any, meta *meta, opts ..

svr := CreateServer(context.TODO(), factory, opts...)
svr.SetEtcdClient(etcdCli)
svr.SetTiKVClient(global_test_tikv)
svr.SetTiKVClient(globalTestTikv)

svr.dataNodeCreator = func(ctx context.Context, addr string, nodeID int64) (types.DataNodeClient, error) {
return newMockDataNodeClient(0, receiveCh)
Expand Down Expand Up @@ -4299,7 +4299,7 @@ func newTestServer2(t *testing.T, receiveCh chan any, opts ...Option) *Server {

svr := CreateServer(context.TODO(), factory, opts...)
svr.SetEtcdClient(etcdCli)
svr.SetTiKVClient(global_test_tikv)
svr.SetTiKVClient(globalTestTikv)

svr.dataNodeCreator = func(ctx context.Context, addr string, nodeID int64) (types.DataNodeClient, error) {
return newMockDataNodeClient(0, receiveCh)
Expand Down Expand Up @@ -4495,7 +4495,7 @@ func testDataCoordBase(t *testing.T, opts ...Option) *Server {

svr := CreateServer(ctx, factory, opts...)
svr.SetEtcdClient(etcdCli)
svr.SetTiKVClient(global_test_tikv)
svr.SetTiKVClient(globalTestTikv)

svr.SetDataNodeCreator(func(ctx context.Context, addr string, nodeID int64) (types.DataNodeClient, error) {
return newMockDataNodeClient(0, nil)
Expand Down
4 changes: 2 additions & 2 deletions internal/kv/tikv/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func setupRemoteTiKV() {
}
}

func setupTiKV(use_remote bool) {
if use_remote {
func setupTiKV(useRemote bool) {
if useRemote {
setupRemoteTiKV()
} else {
setupLocalTiKV()
Expand Down
Loading

0 comments on commit cd5f03f

Please sign in to comment.