Documentation ¶
Index ¶
- Variables
- func ConditionMet[T ComparableOrdered](eq EqualityKind, first, second T) (b bool)
- func NonZeroLen(l int)
- func PanicOnInvalid(ic IntCondition, l int)
- type ComparableOrdered
- type EqualityCondition
- type EqualityKind
- type ErrEqualityCondition
- type ExpectedGot
- type ILowHigh
- type IntCondition
- type IterConfig
- type IterSetup
- type LowHigh
- type NonZero
- type Slice
- type Val
- type WithStep
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IZero = Val{0} IUnbound = Val{-1} )
View Source
var ErrZero = fmt.Errorf("expected non zero value")
View Source
var LenNonZero = &NonZero{}
Functions ¶
func ConditionMet ¶
func ConditionMet[T ComparableOrdered](eq EqualityKind, first, second T) (b bool)
func NonZeroLen ¶
func NonZeroLen(l int)
func PanicOnInvalid ¶
func PanicOnInvalid(ic IntCondition, l int)
Types ¶
type ComparableOrdered ¶
type ComparableOrdered interface { comparable constraints.Ordered }
type EqualityCondition ¶
type EqualityCondition[T ComparableOrdered] struct { // contains filtered or unexported fields }
func NewCondition ¶
func NewCondition[T ComparableOrdered](val T, ek EqualityKind) EqualityCondition[T]
func (EqualityCondition[T]) ConditionMet ¶
func (eq EqualityCondition[T]) ConditionMet(val T) (err error)
type EqualityKind ¶
type EqualityKind int
const ( LargerThan EqualityKind = iota LessThan Equal NotEqual LessOrEqual LargerOrEuqal )
func (EqualityKind) Repr ¶
func (eq EqualityKind) Repr() (s string)
type ErrEqualityCondition ¶
type ErrEqualityCondition[T any] struct { First, Second T Kind EqualityKind }
func (*ErrEqualityCondition[T]) Error ¶
func (e *ErrEqualityCondition[T]) Error() (s string)
type ExpectedGot ¶
type ExpectedGot[T ComparableOrdered] struct { Expected T Kind EqualityKind // contains filtered or unexported fields }
func (ExpectedGot[T]) CheckCondition ¶
func (eg ExpectedGot[T]) CheckCondition() error
func (*ExpectedGot[T]) Got ¶
func (eg *ExpectedGot[T]) Got(got T) *ExpectedGot[T]
type IntCondition ¶
type IterConfig ¶
type Slice ¶
Click to show internal directories.
Click to hide internal directories.