Documentation
¶
Index ¶
- func ComparatorAny[T comparable](a, b T) int
- func ComparatorByte(a, b byte) int
- func ComparatorFloat32(a, b float32) int
- func ComparatorFloat64(a, b float64) int
- func ComparatorInt(a, b int) int
- func ComparatorInt8(a, b int8) int
- func ComparatorInt16(a, b int16) int
- func ComparatorInt32(a, b int32) int
- func ComparatorInt64(a, b int64) int
- func ComparatorRune(a, b rune) int
- func ComparatorString(a, b string) int
- func ComparatorTime(a, b time.Time) int
- func ComparatorUint(a, b uint) int
- func ComparatorUint8(a, b uint8) int
- func ComparatorUint16(a, b uint16) int
- func ComparatorUint32(a, b uint32) int
- func ComparatorUint64(a, b uint64) int
- type Comparator
- type IComparable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparatorAny ¶
func ComparatorAny[T comparable](a, b T) int
ComparatorAny provides a comparison on any types
func ComparatorByte ¶
ComparatorByte provides a basic comparison on byte.
func ComparatorFloat32 ¶
ComparatorFloat32 provides a basic comparison on float32.
func ComparatorFloat64 ¶
ComparatorFloat64 provides a basic comparison on float64.
func ComparatorInt ¶
ComparatorInt provides a basic comparison on int.
func ComparatorInt8 ¶
ComparatorInt8 provides a basic comparison on int8.
func ComparatorInt16 ¶
ComparatorInt16 provides a basic comparison on int16.
func ComparatorInt32 ¶
ComparatorInt32 provides a basic comparison on int32.
func ComparatorInt64 ¶
ComparatorInt64 provides a basic comparison on int64.
func ComparatorRune ¶
ComparatorRune provides a basic comparison on rune.
func ComparatorString ¶
ComparatorString provides a fast comparison on strings.
func ComparatorTime ¶
ComparatorTime provides a basic comparison on time.Time.
func ComparatorUint ¶
ComparatorUint provides a basic comparison on uint.
func ComparatorUint8 ¶
ComparatorUint8 provides a basic comparison on uint8.
func ComparatorUint16 ¶
ComparatorUint16 provides a basic comparison on uint16.
func ComparatorUint32 ¶
ComparatorUint32 provides a basic comparison on uint32.
func ComparatorUint64 ¶
ComparatorUint64 provides a basic comparison on uint64.
Types ¶
type Comparator ¶
type Comparator[T comparable] func(a, b T) int
Comparator is a function that compare a and b, and returns the result as int.
Should return a number:
negative , if a < b zero , if a == b positive , if a > b
func Reverse ¶
func Reverse[T comparable](comp Comparator[T]) Comparator[T]