Documentation ¶
Index ¶
- func Compare[T constraints.Ordered](x, y T) int
- func CompareByKey[K constraints.Ordered, T SortKey[K]](a T, b T) int
- func CompareNumber[T constraintsi.Number](a T, b T) int
- func Equal[T comparable](a T, b T) bool
- func EqualByKey[K constraints.Ordered, T SortKey[K]](a T, b T) bool
- func Greater[T constraints.Ordered](a T, b T) bool
- func GreaterByKey[K constraints.Ordered, T SortKey[K]](a T, b T) bool
- func Less[T constraints.Ordered](a T, b T) bool
- func LessByKey[K constraints.Ordered, T SortKey[K]](a T, b T) bool
- type Comparable
- type CompareFunc
- type CompareKey
- type EqualKey
- type GTValue
- type IsEqual
- type LTValue
- type Sort
- type SortFunc
- type SortKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare[T constraints.Ordered](x, y T) int
func CompareByKey ¶
func CompareByKey[K constraints.Ordered, T SortKey[K]](a T, b T) int
func CompareNumber ¶
func CompareNumber[T constraintsi.Number](a T, b T) int
func Equal ¶
func Equal[T comparable](a T, b T) bool
func EqualByKey ¶
func EqualByKey[K constraints.Ordered, T SortKey[K]](a T, b T) bool
func Greater ¶
func Greater[T constraints.Ordered](a T, b T) bool
func GreaterByKey ¶
func GreaterByKey[K constraints.Ordered, T SortKey[K]](a T, b T) bool
func Less ¶
func Less[T constraints.Ordered](a T, b T) bool
Types ¶
type Comparable ¶
type CompareFunc ¶
type CompareKey ¶
type CompareKey[T constraintsi.Number] interface { CompareKey() T }
type EqualKey ¶
type EqualKey[T comparable] interface { EqualKey() T }
type GTValue ¶
type GTValue[T constraints.Ordered] struct { Value T }
type LTValue ¶
type LTValue[T constraints.Ordered] struct { Value T }
type SortKey ¶ added in v1.7.0
type SortKey[T constraints.Ordered] interface { SortKey() T }
comparable 只能比较是否相等,不能比较大小
Click to show internal directories.
Click to hide internal directories.