match

package
v0.0.0-...-c75a0b7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMatch

func IsMatch(expected, actual any) bool

Types

type AnyType

type AnyType struct{}
var Any AnyType

func (AnyType) Match

func (a AnyType) Match(v any) bool

func (AnyType) String

func (a AnyType) String() string

type BasicMatchers

type BasicMatchers interface {
	AnyType | NotNilType
}

type CustomType

type CustomType[T any] func(v T) bool

func Custom

func Custom[T any](f func(v T) bool) CustomType[T]

func GE

func GE[T constraints.Ordered](v T) CustomType[T]

func GT

func GT[T constraints.Ordered](v T) CustomType[T]

func LE

func LE[T constraints.Ordered](v T) CustomType[T]

func LT

func LT[T constraints.Ordered](v T) CustomType[T]

func (CustomType[T]) Match

func (m CustomType[T]) Match(v any) bool

func (CustomType[T]) String

func (m CustomType[T]) String() string

type NotNilType

type NotNilType struct{}
var NotNil NotNilType

func (NotNilType) Match

func (t NotNilType) Match(v any) bool

func (NotNilType) String

func (t NotNilType) String() string

Jump to

Keyboard shortcuts

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