Skip to content

Commit 0661f1b

Browse files
authored
Merge pull request kubernetes#127682 from mmorel-35/testifylint/[email protected]/client-go
fix: enable error-nil and nil-compare rules from testifylint in module `k8s.io/client-go`
2 parents d2ec60d + 71ced25 commit 0661f1b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

staging/src/k8s.io/client-go/testing/fixture_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ package testing
1919
import (
2020
"fmt"
2121
"math/rand"
22-
"sigs.k8s.io/structured-merge-diff/v4/typed"
2322
"strconv"
2423
"sync"
2524
"testing"
2625

2726
"github.com/stretchr/testify/assert"
27+
"sigs.k8s.io/structured-merge-diff/v4/typed"
2828

2929
v1 "k8s.io/api/core/v1"
3030
"k8s.io/apimachinery/pkg/api/errors"
@@ -450,7 +450,7 @@ func TestGetWithExactMatch(t *testing.T) {
450450
nodeResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "node"}
451451
node, gvr := constructObject(nodeResource, "node", "")
452452

453-
assert.Nil(t, o.Add(node))
453+
assert.NoError(t, o.Add(node))
454454

455455
// Exact match
456456
_, err = o.Get(gvr, "", "node")
@@ -466,7 +466,7 @@ func TestGetWithExactMatch(t *testing.T) {
466466
o = NewObjectTracker(scheme, codecs.UniversalDecoder())
467467
podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pod"}
468468
pod, gvr := constructObject(podResource, "pod", "default")
469-
assert.Nil(t, o.Add(pod))
469+
assert.NoError(t, o.Add(pod))
470470

471471
// Exact match
472472
_, err = o.Get(gvr, "default", "pod")

0 commit comments

Comments
 (0)