mirror of
https://github.com/restic/restic.git
synced 2024-08-31 08:37:35 +02:00
32 lines
730 B
Go
32 lines
730 B
Go
// Copyright 2017, The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE.md file.
|
|
|
|
// +build go1.8
|
|
|
|
package cmpopts
|
|
|
|
import (
|
|
"reflect"
|
|
"sort"
|
|
)
|
|
|
|
const hasReflectStructOf = true
|
|
|
|
func mapEntryType(t reflect.Type) reflect.Type {
|
|
return reflect.StructOf([]reflect.StructField{
|
|
{Name: "K", Type: t.Key()},
|
|
{Name: "V", Type: t.Elem()},
|
|
})
|
|
}
|
|
|
|
func sliceIsSorted(slice interface{}, less func(i, j int) bool) bool {
|
|
return sort.SliceIsSorted(slice, less)
|
|
}
|
|
func sortSlice(slice interface{}, less func(i, j int) bool) {
|
|
sort.Slice(slice, less)
|
|
}
|
|
func sortSliceStable(slice interface{}, less func(i, j int) bool) {
|
|
sort.SliceStable(slice, less)
|
|
}
|