(v reflect.Value)
| 154 | return dst.Interface() |
| 155 | } |
| 156 | func (ms mapSorter) checkSort(v reflect.Value) { |
| 157 | for i := 1; i < v.Len(); i++ { |
| 158 | if !ms.less(v, i-1, i) { |
| 159 | panic(fmt.Sprintf("partial order detected: want %v < %v", v.Index(i-1), v.Index(i))) |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | func (ms mapSorter) less(v reflect.Value, i, j int) bool { |
| 164 | vx, vy := v.Index(i).Field(0), v.Index(j).Field(0) |
| 165 | vo := ms.fnc.Call([]reflect.Value{vx, vy})[0] |