lang

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Equal = internal.Equal

Functions

func AppendElementUnique

func AppendElementUnique[T any](slice []T, value T) []T

func Cast

func Cast[T any](val interface{}) (T, error)

func CastOrZero

func CastOrZero[T any](val interface{}) (T, error)

func CastQuietly

func CastQuietly[T any](val interface{}) T

func DefaultErrorFn

func DefaultErrorFn(err error, defErrFn func() error) error

func DefaultErrorMsg

func DefaultErrorMsg(err error, format string, p ...any) error

func IsZero

func IsZero(val any) bool

func Max

func Max(x, y int64) int64

func Min

func Min(x, y int64) int64

func PanicIfError

func PanicIfError(err error)

func RemoveElementByValue

func RemoveElementByValue[T any](slice []T, value T) []T

func ToBool

func ToBool(str string) bool

func Zero

func Zero[T any]() T

Types

type MultiError

type MultiError []error

func (*MultiError) Append

func (errs *MultiError) Append(err error)

func (MultiError) Error

func (errs MultiError) Error() string

func (MultiError) MaybeUnwrap

func (errs MultiError) MaybeUnwrap() error

type PanicError

type PanicError struct {
	// contains filtered or unexported fields
}

func WrapPanic

func WrapPanic(v any) *PanicError

func (*PanicError) Error

func (e *PanicError) Error() string

func (*PanicError) Origin

func (e *PanicError) Origin() any

type Panicked

type Panicked chan any

func (Panicked) Caught

func (pr Panicked) Caught() <-chan any

func (Panicked) Recover

func (pr Panicked) Recover()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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