mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Merge pull request #135219 from skitt/valswap
Enforce Golang a, b = b, a swaps
This commit is contained in:
commit
1c0eb534ca
3 changed files with 2 additions and 8 deletions
|
|
@ -443,7 +443,6 @@ linters:
|
|||
- typeSwitchVar
|
||||
- underef
|
||||
- unslice
|
||||
- valSwap
|
||||
revive:
|
||||
# Only these rules are enabled.
|
||||
rules:
|
||||
|
|
|
|||
|
|
@ -253,7 +253,6 @@ linters:
|
|||
- typeSwitchVar
|
||||
- underef
|
||||
- unslice
|
||||
- valSwap
|
||||
{{- end}}
|
||||
revive:
|
||||
# Only these rules are enabled.
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue