Fix golang-ci linter errors (#10128)
* Fix golang-ci linter errors Signed-off-by: z1cheng <imchench@gmail.com> * Fix gofmt errors Signed-off-by: z1cheng <imchench@gmail.com> * Add nolint comment to defaults.Backend in Configuration Signed-off-by: z1cheng <imchench@gmail.com> * Add #nosec comment to rand.New func Signed-off-by: z1cheng <imchench@gmail.com> * Fix errcheck warnings Signed-off-by: z1cheng <imchench@gmail.com> * Fix gofmt check Signed-off-by: z1cheng <imchench@gmail.com> * Fix unit tests and comments Signed-off-by: z1cheng <imchench@gmail.com> --------- Signed-off-by: z1cheng <imchench@gmail.com>
This commit is contained in:
parent
f50431a9f9
commit
d44a8e0045
37 changed files with 206 additions and 162 deletions
|
|
@ -59,7 +59,9 @@ func TestEndpointSliceLister(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
el.Add(endpointSlice)
|
||||
if err := el.Add(endpointSlice); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
endpointSlice = &discoveryv1.EndpointSlice{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: "namespace",
|
||||
|
|
@ -69,7 +71,9 @@ func TestEndpointSliceLister(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
el.Add(endpointSlice)
|
||||
if err := el.Add(endpointSlice); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
endpointSlice = &discoveryv1.EndpointSlice{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: "namespace",
|
||||
|
|
@ -79,7 +83,9 @@ func TestEndpointSliceLister(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
el.Add(endpointSlice)
|
||||
if err := el.Add(endpointSlice); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
eps, err := el.MatchByKey(key)
|
||||
|
||||
if err != nil {
|
||||
|
|
@ -108,7 +114,9 @@ func TestEndpointSliceLister(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
el.Add(endpointSlice)
|
||||
if err := el.Add(endpointSlice); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
endpointSlice2 := &discoveryv1.EndpointSlice{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: ns2,
|
||||
|
|
@ -118,7 +126,9 @@ func TestEndpointSliceLister(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
el.Add(endpointSlice2)
|
||||
if err := el.Add(endpointSlice2); err != nil {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
eps, err := el.MatchByKey(key)
|
||||
if err != nil {
|
||||
t.Errorf("unexpeted error %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue