(v reflect.Value, i, j int)
| 85 | } |
| 86 | } |
| 87 | func (ss sliceSorter) less(v reflect.Value, i, j int) bool { |
| 88 | vx, vy := v.Index(i), v.Index(j) |
| 89 | vo := ss.fnc.Call([]reflect.Value{vx, vy})[0] |
| 90 | if vo.Kind() == reflect.Bool { |
| 91 | return vo.Bool() |
| 92 | } else { |
| 93 | return vo.Int() < 0 |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // SortMaps returns a [cmp.Transformer] option that flattens map[K]V types to be |
| 98 | // a sorted []struct{K, V}. The lessOrCompareFunc function must be either |