assert

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool2Integer added in v0.1.2

func Bool2Integer[T Integer](b bool) T

func Contains

func Contains[S ~[]E, E comparable](t common.T, s S, v E)

func ContainsString

func ContainsString(t common.T, s, v string)

func DumpHex added in v0.1.2

func DumpHex[T []byte | *bytes.Buffer](buf T) (dump string)

func Empty

func Empty(t common.T, object any)

func Equal

func Equal[T any](t common.T, want, got T, opts ...cmp.Option)

func Equalf

func Equalf(t common.T, expected any, actual any, msg string, args ...any)

func Error

func Error(t common.T, e error)

func False

func False(t common.T, x bool)

func FormatInteger added in v0.1.2

func FormatInteger[T Integer](data T) string

func FormatIntegerHex added in v0.1.2

func FormatIntegerHex[T Integer](data T) string

func FormatIntegerHex0x added in v0.1.2

func FormatIntegerHex0x[T Integer](data T) string

func GreaterThan

func GreaterThan[T Ordered](t common.T, big, small T)

func GreaterThanOrEqual

func GreaterThanOrEqual[T Ordered](t common.T, big, small T)

func In

func In[T any](t common.T, element T, slice []T, opts ...cmp.Option)

func Integer2Bool added in v0.1.2

func Integer2Bool[T Integer](value T) bool

func IsASCIIDigit added in v0.1.2

func IsASCIIDigit(s string) bool

func IsIncludeLine added in v0.1.2

func IsIncludeLine(s string) bool

func Len

func Len(t common.T, object any, length int)

func LessThan

func LessThan[T Ordered](t common.T, small, big T)

func LessThanOrEqual

func LessThanOrEqual[T Ordered](t common.T, small, big T)

func Nil

func Nil(t common.T, v any)

func NoError

func NoError(t common.T, e error)

func NotContains

func NotContains[S ~[]E, E comparable](t common.T, s S, v E)

func NotContainsString

func NotContainsString(t common.T, s, v string)

func NotEmpty

func NotEmpty(t common.T, object any)

func NotEqual

func NotEqual[T any](t common.T, want, got T, opts ...cmp.Option)

func NotIn

func NotIn[T any](t common.T, element T, slice []T, opts ...cmp.Option)

func NotNil

func NotNil(t common.T, v any)

func NotPanics

func NotPanics(t common.T, expected any)

func NotZero

func NotZero(t common.T, v any)

func Panics

func Panics(t common.T, f func())

func True

func True(t common.T, x bool)

func UnsignedInteger

func UnsignedInteger[T Unsigned](t common.T, want, got T, opts ...cmp.Option)

func ValueIsBytesType added in v0.1.2

func ValueIsBytesType(v reflect.Value) bool

func Zero

func Zero(t common.T, v any)

Types

type Complex added in v0.1.2

type Complex interface {
	~complex64 | ~complex128
}

type Float added in v0.1.2

type Float interface {
	~float32 | ~float64
}

type Integer added in v0.1.2

type Integer interface {
	Signed | Unsigned
}

type Ordered added in v0.1.2

type Ordered interface {
	Integer | Float | ~string
}

type Signed added in v0.1.2

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned added in v0.1.2

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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