compare

package
v0.0.0-...-32c7374 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bin128

func Bin128(a, b bin.Bin128) int

func Bin128Error

func Bin128Error(a, b bin.Bin128) (int, error)

func Bin128Status

func Bin128Status(a, b bin.Bin128) (int, status.Status)

func Bin256

func Bin256(a, b bin.Bin256) int

func Bin256Error

func Bin256Error(a, b bin.Bin256) (int, error)

func Bin256Status

func Bin256Status(a, b bin.Bin256) (int, status.Status)

func Bin64

func Bin64(a, b bin.Bin64) int

func Bin64Error

func Bin64Error(a, b bin.Bin64) (int, error)

func Bin64Status

func Bin64Status(a, b bin.Bin64) (int, status.Status)

func Bool

func Bool(a, b bool) int

func BoolError

func BoolError(a, b bool) (int, error)

func BoolStatus

func BoolStatus(a, b bool) (int, status.Status)

func Byte

func Byte(a, b byte) int

func ByteError

func ByteError(a, b byte) (int, error)

func ByteStatus

func ByteStatus(a, b byte) (int, status.Status)

func Bytes

func Bytes(a, b []byte) int

func BytesError

func BytesError(a, b []byte) (int, error)

func BytesStatus

func BytesStatus(a, b []byte) (int, status.Status)

func Duration

func Duration(a, b time.Duration) int

func DurationError

func DurationError(a, b time.Duration) (int, error)

func DurationStatus

func DurationStatus(a, b time.Duration) (int, status.Status)

func Float32

func Float32(a, b float32) int

func Float32Error

func Float32Error(a, b float32) (int, error)

func Float32Status

func Float32Status(a, b float32) (int, status.Status)

func Float64

func Float64(a, b float64) int

func Float64Error

func Float64Error(a, b float64) (int, error)

func Float64Status

func Float64Status(a, b float64) (int, status.Status)

func Int

func Int(a, b int) int

func Int16

func Int16(a, b int16) int

func Int16Error

func Int16Error(a, b int16) (int, error)

func Int16Status

func Int16Status(a, b int16) (int, status.Status)

func Int32

func Int32(a, b int32) int

func Int32Error

func Int32Error(a, b int32) (int, error)

func Int32Status

func Int32Status(a, b int32) (int, status.Status)

func Int64

func Int64(a, b int64) int

func Int64Error

func Int64Error(a, b int64) (int, error)

func Int64Status

func Int64Status(a, b int64) (int, status.Status)

func IntError

func IntError(a, b int) (int, error)

func IntStatus

func IntStatus(a, b int) (int, status.Status)

func String

func String(a, b string) int

func StringError

func StringError(a, b string) (int, error)

func StringStatus

func StringStatus(a, b string) (int, status.Status)

func Time

func Time(a, b time.Time) int

func TimeError

func TimeError(a, b time.Time) (int, error)

func TimeStatus

func TimeStatus(a, b time.Time) (int, status.Status)

func Uint

func Uint(a, b uint) int

func Uint16

func Uint16(a, b uint16) int

func Uint16Error

func Uint16Error(a, b uint16) (int, error)

func Uint16Status

func Uint16Status(a, b uint16) (int, status.Status)

func Uint32

func Uint32(a, b uint32) int

func Uint32Error

func Uint32Error(a, b uint32) (int, error)

func Uint32Status

func Uint32Status(a, b uint32) (int, status.Status)

func Uint64

func Uint64(a, b uint64) int

func Uint64Error

func Uint64Error(a, b uint64) (int, error)

func Uint64Status

func Uint64Status(a, b uint64) (int, status.Status)

func UintError

func UintError(a, b uint) (int, error)

func UintStatus

func UintStatus(a, b uint) (int, status.Status)

Types

type Compare

type Compare[T any] func(a, b T) int

Compare compares to values and returns the result. The result should be 0 if a == b, negative if a < b, and positive if a > b.

func Ordered

func Ordered[T constraints.Ordered]() Compare[T]

Ordered returns a comparison function for a natually ordered type.

type CompareBytes

type CompareBytes = Compare[[]byte]

type CompareBytesError

type CompareBytesError = CompareError[[]byte]

type CompareBytesStatus

type CompareBytesStatus = CompareStatus[[]byte]

type CompareError

type CompareError[T any] func(a, b T) (int, error)

CompareError compares to values and returns the result, or an error. The result should be 0 if a == b, negative if a < b, and positive if a > b.

func OrderedError

func OrderedError[T constraints.Ordered]() CompareError[T]

OrderedError returns a comparison function for a natually ordered type.

type CompareStatus

type CompareStatus[T any] func(a, b T) (int, status.Status)

CompareStatus compares to values and returns the result and a status. The result should be 0 if a == b, negative if a < b, and positive if a > b.

func OrderedStatus

func OrderedStatus[T constraints.Ordered]() CompareStatus[T]

OrderedStatus returns a comparison function for a natually ordered type.

type CompareTo

type CompareTo[T any] func(value T) int

CompareTo compares a value to another and returns the result. The result should be 0 if value == another, <0 if value < another, and >0 if value > another.

Example:

var another int
func(value int) int {
	return value - another
}

type CompareToError

type CompareToError[T any] func(value T) (int, error)

CompareToError compares a value to another and returns the result, or an error. The result should be 0 if value == another, <0 if value < another, and >0 if value > another.

Example:

var another int
func(value int) (int, error) {
	return value - another, nil
}

type CompareToStatus

type CompareToStatus[T any] func(value T) (int, status.Status)

CompareToStatus compares a value to another and returns the result and a status. The result should be 0 if value == another, <0 if value < another, and >0 if value > another.

Example:

var another int
func(value int) (int, status.Status) {
	return value - another, status.OK
}

Jump to

Keyboard shortcuts

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