mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-12-01 07:26:05 +07:00
fix gosimple lint
TODO: this is fine here, but we should maybe disable this bad linter. These are not functionally equivilant: The for loop guarantees src is copied in full (or else will panic on bad index) while copy will copy up to the smallest length of either src or dest.
This commit is contained in:
@@ -154,9 +154,7 @@ func Test_sortNetworkInspectEntries(t *testing.T) {
|
||||
tc := tc
|
||||
t.Run(tc.Name, func(t *testing.T) {
|
||||
toSort := make([]networkInspectEntry, len(tc.Networks))
|
||||
for i := range tc.Networks {
|
||||
toSort[i] = tc.Networks[i]
|
||||
}
|
||||
copy(toSort, tc.Networks)
|
||||
sortNetworkInspectEntries(toSort)
|
||||
assert.DeepEqual(t, tc.Sorted, toSort)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user