check

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 3 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Between

func Between[T constraints.Ordered](v, lo, hi T, details ...any) T

func Condition

func Condition(b bool, details ...any)

func Contains

func Contains[T any](ctr Container[T], v T, details ...any) T

func EmptySlice

func EmptySlice[T any](s []T, details ...any) []T

func Equal

func Equal[T comparable](actual, expected T, details ...any) T

func IgnoreErr

func IgnoreErr(err error)

func IgnoreErr1

func IgnoreErr1[T any](v T, err error) T

func IgnoreErr2

func IgnoreErr2[T, U any](v T, v2 U, err error) (T, U)

func IgnoreOk

func IgnoreOk(bool bool)

func IgnoreOk1

func IgnoreOk1[T any](v T, ok bool) T

func IgnoreOk2

func IgnoreOk2[T, U any](v T, v2 U, ok bool) (T, U)

func Must

func Must(err error)

func Must1

func Must1[T any](v T, err error) T

func Must2

func Must2[T, U any](v T, v2 U, err error) (T, U)

func Nil

func Nil(v any, details ...any) any

func NotContains

func NotContains[T any](ctr Container[T], v T, details ...any) T

func NotEmpty

func NotEmpty[T HasLen](ctr T, details ...any) T

func NotEmptySlice

func NotEmptySlice[T any](s []T, details ...any) []T

func NotEmptyStr

func NotEmptyStr(s string, details ...any) string

func NotEqual

func NotEqual[T comparable](actual, expected T, details ...any) T

func NotNil

func NotNil(v any, details ...any) any

func NotZero

func NotZero[T comparable](v T, details ...any) T

func Ok

func Ok(ok bool)

func Ok1

func Ok1[T any](v T, ok bool) T

func Ok2

func Ok2[T, U any](v T, v2 U, ok bool) (T, U)

func Pair

func Pair[T any](s []T, details ...any) (T, T)

func Single

func Single[T any](s []T, details ...any) T

Types

type CheckError

type CheckError struct {
	Message string
	Args    []any
	Details []any
}

func (CheckError) Error

func (e CheckError) Error() string

func (CheckError) String

func (e CheckError) String() string

type Container

type Container[T any] interface {
	Contains(v T) bool
}

type HasLen

type HasLen interface {
	Len() int
}

Jump to

Keyboard shortcuts

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