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:
Benjamin Elder
2022-05-27 13:41:28 -07:00
parent 3a4b3fb7e3
commit 51bb7d7e4d

View File

@@ -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)
})