util

package
v0.0.0-...-f6cfca9 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual[T comparable](value, expected T, t *testing.T)

func AssertEqualSlice

func AssertEqualSlice[T comparable](value, expected []T, t *testing.T)

func AssertFalse

func AssertFalse(value bool, t *testing.T)

func AssertNil

func AssertNil[T comparable](value *T, t *testing.T)

func AssertNotEqual

func AssertNotEqual[T comparable](value, expected T, t *testing.T)

func AssertNotEqualSlice

func AssertNotEqualSlice[T comparable](value, expected []T, t *testing.T)

func AssertNotNil

func AssertNotNil[T comparable](value *T, t *testing.T)

func AssertTrue

func AssertTrue(value bool, t *testing.T)

func Filler

func Filler[T any](f T) T

func GreaterThan

func GreaterThan[T constraints.Ordered](a, b T) bool

func Hash

func Hash[A comparable](a A) uintptr

func LessThan

func LessThan[T constraints.Ordered](a, b T) bool

func Max

func Max[T constraints.Ordered](elements ...T) (maxima T)

func Min

func Min[T constraints.Ordered](elements ...T) (minima T)

func MinMax

func MinMax[T constraints.Ordered](elements ...T) (minima, maxima T)

func SortNumerics

func SortNumerics[N Numeric](numbers []N)

Types

type Numeric

type Numeric interface {
	constraints.Float | constraints.Integer
}

type Predicate

type Predicate[T any] func(T) bool

type Transform

type Transform[T, U any] func(T) U

Jump to

Keyboard shortcuts

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