comparison

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 10

Documentation

Index

Constants

View Source
const (
	FirstSmaller  int = -1
	Equal             = 0
	SecondSmaller     = 1

	FirstBigger  = SecondSmaller
	SecondBigger = FirstSmaller
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator added in v1.0.2

type Comparator[T any] func(first, second T) int

func NewByField added in v1.0.4

func NewByField[T any, P cmp.Ordered](getter functions.Mapper[T, P]) Comparator[T]

func (Comparator[T]) Less added in v1.0.2

func (comparator Comparator[T]) Less() func(first, second T) bool

func (Comparator[T]) Reverse added in v1.0.2

func (comparator Comparator[T]) Reverse() Comparator[T]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL