Skip to content

Commit

Permalink
Fix deepsource: VET-V0008 Lock erroneously passed by value internal/c…
Browse files Browse the repository at this point in the history
…lient (#1862)

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>
  • Loading branch information
hlts2 and vankichi authored Nov 22, 2022
1 parent 682f68d commit 288e665
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
25 changes: 0 additions & 25 deletions internal/client/v1/client/filter/egress/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package egress
import (
"context"
"reflect"
"sync"
"testing"

"github.com/vdaas/vald/apis/grpc/v1/filter/egress"
Expand Down Expand Up @@ -115,7 +114,6 @@ func Test_client_Start(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -150,7 +148,6 @@ func Test_client_Start(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -168,7 +165,6 @@ func Test_client_Start(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -195,7 +191,6 @@ func Test_client_Start(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -214,7 +209,6 @@ func Test_client_Stop(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -245,7 +239,6 @@ func Test_client_Stop(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -263,7 +256,6 @@ func Test_client_Stop(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -290,7 +282,6 @@ func Test_client_Stop(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -306,7 +297,6 @@ func Test_client_GRPCClient(t *testing.T) {
t.Parallel()
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand All @@ -333,7 +323,6 @@ func Test_client_GRPCClient(t *testing.T) {
name: "test_case_1",
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -348,7 +337,6 @@ func Test_client_GRPCClient(t *testing.T) {
name: "test_case_2",
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -375,7 +363,6 @@ func Test_client_GRPCClient(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -395,7 +382,6 @@ func Test_client_Target(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -431,7 +417,6 @@ func Test_client_Target(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -450,7 +435,6 @@ func Test_client_Target(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -477,7 +461,6 @@ func Test_client_Target(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -498,7 +481,6 @@ func Test_client_FilterDistance(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -535,7 +517,6 @@ func Test_client_FilterDistance(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -555,7 +536,6 @@ func Test_client_FilterDistance(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -582,7 +562,6 @@ func Test_client_FilterDistance(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand Down Expand Up @@ -805,7 +784,6 @@ func Test_client_FilterVector(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -842,7 +820,6 @@ func Test_client_FilterVector(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -862,7 +839,6 @@ func Test_client_FilterVector(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -889,7 +865,6 @@ func Test_client_FilterVector(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand Down
25 changes: 0 additions & 25 deletions internal/client/v1/client/filter/ingress/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package ingress
import (
"context"
"reflect"
"sync"
"testing"

"github.com/vdaas/vald/apis/grpc/v1/filter/ingress"
Expand Down Expand Up @@ -115,7 +114,6 @@ func Test_client_Start(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -150,7 +148,6 @@ func Test_client_Start(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -168,7 +165,6 @@ func Test_client_Start(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -195,7 +191,6 @@ func Test_client_Start(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -214,7 +209,6 @@ func Test_client_Stop(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -245,7 +239,6 @@ func Test_client_Stop(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -263,7 +256,6 @@ func Test_client_Stop(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -290,7 +282,6 @@ func Test_client_Stop(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -306,7 +297,6 @@ func Test_client_GRPCClient(t *testing.T) {
t.Parallel()
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand All @@ -333,7 +323,6 @@ func Test_client_GRPCClient(t *testing.T) {
name: "test_case_1",
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -348,7 +337,6 @@ func Test_client_GRPCClient(t *testing.T) {
name: "test_case_2",
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -375,7 +363,6 @@ func Test_client_GRPCClient(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -395,7 +382,6 @@ func Test_client_Target(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -431,7 +417,6 @@ func Test_client_Target(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -450,7 +435,6 @@ func Test_client_Target(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -477,7 +461,6 @@ func Test_client_Target(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -498,7 +481,6 @@ func Test_client_GenVector(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -535,7 +517,6 @@ func Test_client_GenVector(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -555,7 +536,6 @@ func Test_client_GenVector(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -582,7 +562,6 @@ func Test_client_GenVector(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand All @@ -603,7 +582,6 @@ func Test_client_FilterVector(t *testing.T) {
}
type fields struct {
addrs []string
cl sync.Map
c grpc.Client
}
type want struct {
Expand Down Expand Up @@ -640,7 +618,6 @@ func Test_client_FilterVector(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -660,7 +637,6 @@ func Test_client_FilterVector(t *testing.T) {
},
fields: fields {
addrs: nil,
cl: sync.Map{},
c: nil,
},
want: want{},
Expand All @@ -687,7 +663,6 @@ func Test_client_FilterVector(t *testing.T) {
}
c := &client{
addrs: test.fields.addrs,
cl: test.fields.cl,
c: test.fields.c,
}

Expand Down

0 comments on commit 288e665

Please sign in to comment.