diff --git a/hack/golangci.yaml b/hack/golangci.yaml index 70085e744e2..917c2d547be 100644 --- a/hack/golangci.yaml +++ b/hack/golangci.yaml @@ -443,7 +443,6 @@ linters: - typeSwitchVar - underef - unslice - - valSwap revive: # Only these rules are enabled. rules: diff --git a/hack/golangci.yaml.in b/hack/golangci.yaml.in index 13da763a9a8..a8adbf4b014 100644 --- a/hack/golangci.yaml.in +++ b/hack/golangci.yaml.in @@ -253,7 +253,6 @@ linters: - typeSwitchVar - underef - unslice - - valSwap {{- end}} revive: # Only these rules are enabled. diff --git a/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go b/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go index 6825a808e67..71f6b5e875c 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go @@ -1827,9 +1827,7 @@ func (ss SortableSliceOfMaps) Less(i, j int) bool { } func (ss SortableSliceOfMaps) Swap(i, j int) { - tmp := ss.s[i] - ss.s[i] = ss.s[j] - ss.s[j] = tmp + ss.s[i], ss.s[j] = ss.s[j], ss.s[i] } func deduplicateAndSortScalars(s []interface{}) []interface{} { @@ -1875,9 +1873,7 @@ func (ss SortableSliceOfScalars) Less(i, j int) bool { } func (ss SortableSliceOfScalars) Swap(i, j int) { - tmp := ss.s[i] - ss.s[i] = ss.s[j] - ss.s[j] = tmp + ss.s[i], ss.s[j] = ss.s[j], ss.s[i] } // Returns the type of the elements of N slice(s). If the type is different,