From 2fd5fd67518e36a581d2a7b7c82d8b60fefb9cfe Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Thu, 19 Oct 2023 20:49:18 +0300 Subject: [PATCH] tests(store): fix linter errcheck failure Signed-off-by: Boris Glimcher --- pkg/evpn/bridge_test.go | 10 +++++----- pkg/evpn/port_test.go | 14 +++++++------- pkg/evpn/svi_test.go | 18 +++++++++--------- pkg/evpn/vrf_test.go | 10 +++++----- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pkg/evpn/bridge_test.go b/pkg/evpn/bridge_test.go index e78aefd6..8ac8c578 100644 --- a/pkg/evpn/bridge_test.go +++ b/pkg/evpn/bridge_test.go @@ -279,7 +279,7 @@ func Test_CreateLogicalBridge(t *testing.T) { client := pb.NewLogicalBridgeServiceClient(conn) if tt.exist { - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -450,7 +450,7 @@ func Test_DeleteLogicalBridge(t *testing.T) { client := pb.NewLogicalBridgeServiceClient(conn) fname1 := resourceIDToFullName("bridges", tt.in) - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) if tt.on != nil { tt.on(mockNetlink, mockFrr, tt.errMsg) @@ -544,7 +544,7 @@ func Test_UpdateLogicalBridge(t *testing.T) { client := pb.NewLogicalBridgeServiceClient(conn) if tt.exist { - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -627,7 +627,7 @@ func Test_GetLogicalBridge(t *testing.T) { }(conn) client := pb.NewLogicalBridgeServiceClient(conn) - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) request := &pb.GetLogicalBridgeRequest{Name: tt.in} response, err := client.GetLogicalBridge(ctx, request) @@ -734,7 +734,7 @@ func Test_ListLogicalBridges(t *testing.T) { }(conn) client := pb.NewLogicalBridgeServiceClient(conn) - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) opi.ListHelper[testLogicalBridgeName] = false opi.Pagination["existing-pagination-token"] = 1 diff --git a/pkg/evpn/port_test.go b/pkg/evpn/port_test.go index 1db48b47..0cc077b0 100644 --- a/pkg/evpn/port_test.go +++ b/pkg/evpn/port_test.go @@ -319,9 +319,9 @@ func Test_CreateBridgePort(t *testing.T) { }(conn) client := pb.NewBridgePortServiceClient(conn) - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) if tt.exist { - opi.store.Set(testBridgePortName, &testBridgePortWithStatus) + _ = opi.store.Set(testBridgePortName, &testBridgePortWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -479,8 +479,8 @@ func Test_DeleteBridgePort(t *testing.T) { client := pb.NewBridgePortServiceClient(conn) fname1 := resourceIDToFullName("ports", tt.in) - opi.store.Set(testBridgePortName, &testBridgePortWithStatus) - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testBridgePortName, &testBridgePortWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) if tt.on != nil { tt.on(mockNetlink, mockFrr, tt.errMsg) } @@ -574,7 +574,7 @@ func Test_UpdateBridgePort(t *testing.T) { client := pb.NewBridgePortServiceClient(conn) if tt.exist { - opi.store.Set(testBridgePortName, &testBridgePortWithStatus) + _ = opi.store.Set(testBridgePortName, &testBridgePortWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -657,7 +657,7 @@ func Test_GetBridgePort(t *testing.T) { }(conn) client := pb.NewBridgePortServiceClient(conn) - opi.store.Set(testBridgePortName, &testBridgePortWithStatus) + _ = opi.store.Set(testBridgePortName, &testBridgePortWithStatus) request := &pb.GetBridgePortRequest{Name: tt.in} response, err := client.GetBridgePort(ctx, request) @@ -764,7 +764,7 @@ func Test_ListBridgePorts(t *testing.T) { }(conn) client := pb.NewBridgePortServiceClient(conn) - opi.store.Set(testBridgePortName, &testBridgePortWithStatus) + _ = opi.store.Set(testBridgePortName, &testBridgePortWithStatus) opi.ListHelper[testBridgePortName] = false opi.Pagination["existing-pagination-token"] = 1 diff --git a/pkg/evpn/svi_test.go b/pkg/evpn/svi_test.go index d57cb613..fe32f43e 100644 --- a/pkg/evpn/svi_test.go +++ b/pkg/evpn/svi_test.go @@ -421,7 +421,7 @@ func Test_CreateSvi(t *testing.T) { client := pb.NewSviServiceClient(conn) if tt.exist { - opi.store.Set(testSviName, &testSviWithStatus) + _ = opi.store.Set(testSviName, &testSviWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -430,8 +430,8 @@ func Test_CreateSvi(t *testing.T) { if tt.on != nil { tt.on(mockNetlink, mockFrr, tt.errMsg) } - opi.store.Set(testVrfName, &testVrfWithStatus) - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testVrfName, &testVrfWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) request := &pb.CreateSviRequest{Svi: tt.in, SviId: tt.id} response, err := client.CreateSvi(ctx, request) @@ -606,9 +606,9 @@ func Test_DeleteSvi(t *testing.T) { client := pb.NewSviServiceClient(conn) fname1 := resourceIDToFullName("svis", tt.in) - opi.store.Set(testSviName, &testSviWithStatus) - opi.store.Set(testVrfName, &testVrfWithStatus) - opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) + _ = opi.store.Set(testSviName, &testSviWithStatus) + _ = opi.store.Set(testVrfName, &testVrfWithStatus) + _ = opi.store.Set(testLogicalBridgeName, &testLogicalBridgeWithStatus) if tt.on != nil { tt.on(mockNetlink, mockFrr, tt.errMsg) } @@ -703,7 +703,7 @@ func Test_UpdateSvi(t *testing.T) { client := pb.NewSviServiceClient(conn) if tt.exist { - opi.store.Set(testSviName, &testSviWithStatus) + _ = opi.store.Set(testSviName, &testSviWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -786,7 +786,7 @@ func Test_GetSvi(t *testing.T) { }(conn) client := pb.NewSviServiceClient(conn) - opi.store.Set(testSviName, &testSviWithStatus) + _ = opi.store.Set(testSviName, &testSviWithStatus) request := &pb.GetSviRequest{Name: tt.in} response, err := client.GetSvi(ctx, request) @@ -893,7 +893,7 @@ func Test_ListSvis(t *testing.T) { }(conn) client := pb.NewSviServiceClient(conn) - opi.store.Set(testSviName, &testSviWithStatus) + _ = opi.store.Set(testSviName, &testSviWithStatus) opi.ListHelper[testSviName] = false opi.Pagination["existing-pagination-token"] = 1 diff --git a/pkg/evpn/vrf_test.go b/pkg/evpn/vrf_test.go index e8ff6784..f2c1cce9 100644 --- a/pkg/evpn/vrf_test.go +++ b/pkg/evpn/vrf_test.go @@ -348,7 +348,7 @@ func Test_CreateVrf(t *testing.T) { client := pb.NewVrfServiceClient(conn) if tt.exist { - opi.store.Set(testVrfName, &testVrfWithStatus) + _ = opi.store.Set(testVrfName, &testVrfWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -644,7 +644,7 @@ func Test_DeleteVrf(t *testing.T) { client := pb.NewVrfServiceClient(conn) fname1 := resourceIDToFullName("vrfs", tt.in) - opi.store.Set(testVrfName, &testVrfWithStatus) + _ = opi.store.Set(testVrfName, &testVrfWithStatus) if tt.on != nil { tt.on(mockNetlink, mockFrr, tt.errMsg) } @@ -739,7 +739,7 @@ func Test_UpdateVrf(t *testing.T) { client := pb.NewVrfServiceClient(conn) if tt.exist { - opi.store.Set(testVrfName, &testVrfWithStatus) + _ = opi.store.Set(testVrfName, &testVrfWithStatus) } if tt.out != nil { tt.out = protoClone(tt.out) @@ -822,7 +822,7 @@ func Test_GetVrf(t *testing.T) { }(conn) client := pb.NewVrfServiceClient(conn) - opi.store.Set(testVrfName, &testVrfWithStatus) + _ = opi.store.Set(testVrfName, &testVrfWithStatus) request := &pb.GetVrfRequest{Name: tt.in} response, err := client.GetVrf(ctx, request) @@ -929,7 +929,7 @@ func Test_ListVrfs(t *testing.T) { }(conn) client := pb.NewVrfServiceClient(conn) - opi.store.Set(testVrfName, &testVrfWithStatus) + _ = opi.store.Set(testVrfName, &testVrfWithStatus) opi.ListHelper[testVrfName] = false opi.Pagination["existing-pagination-token"] = 1