Documentation ¶
Index ¶
- Constants
- Variables
- func Assert(value bool, WhatWillPanic ...interface{})
- func Bits[T constraints.Integer](n T) int
- func Box(fn func()) (recovered interface{})
- func Cast[T any](t interface{}) T
- func Catch[T any](fn func(recovered T))
- func DeRef[T any](ptr uintptr) T
- func Equal(a, b any) bool
- func Just(closable func() error)
- func Loop()
- func MustMarshalBinary(value encoding.BinaryMarshaler) []byte
- func MustMarshalText(value encoding.TextMarshaler) []byte
- func Rand(length int) []byte
- func Recover[T any]() T
- func Ref[T any](value *T) uintptr
- func Stop(t *time.Timer)
- func Throw(values ...interface{})
- type ByNames
- type Empty
- type NoCompare
- type NoCopy
Constants ¶
View Source
const Day = time.Hour * 24
View Source
const MaxInt = int(MaxUint >> 1)
MaxInt is max int value
View Source
const MaxUint = ^uint(0)
MaxUint is max uint value
View Source
const Month = Day * 30
View Source
const UintptrSize = unsafe.Sizeof(uintptr(0))
UintptrSize is memory size of uintptr
View Source
const Week = Day * 7
View Source
const Year = Day * 365
Variables ¶
View Source
var ErrAssertion = errors.New("assertion")
ErrAssertion is an assertion failed error
Functions ¶
func Assert ¶
func Assert(value bool, WhatWillPanic ...interface{})
Assert panic WhatWillPanic for ErrAssertion if value is false
func Box ¶
func Box(fn func()) (recovered interface{})
Box call fn and recover a panic and returns recovered value
func Catch ¶
func Catch[T any](fn func(recovered T))
Catch call fn with recovered value is it's not nil
func MustMarshalBinary ¶
func MustMarshalBinary(value encoding.BinaryMarshaler) []byte
func MustMarshalText ¶
func MustMarshalText(value encoding.TextMarshaler) []byte
Types ¶
type ByNames ¶
type ByNames struct {
// contains filtered or unexported fields
}
ByNames force struct to init with fields name
Click to show internal directories.
Click to hide internal directories.