Documentation ¶
Index ¶
- func Assert(cond bool, msg string)
- func AssertEq[T comparable](a T, b T, msg string)
- func AssertFalse(msg string)
- func AssertNeq[T comparable](a T, b T, msg string)
- func AssertNot(cond bool, msg string)
- func AssertNotNil[T any](ptr *T, msg string)
- func Assertf(cond bool, format string, a ...any)
- func Capture(value any)
- func CaptureResult(f func() any)
- func Comment(values ...any)
- func CommentResult(f func() string)
- func Commentf(format string, values ...any)
- func Commentln(values ...any)
- func Defer(f func())
- func DoFinally()
- func Finally(finally func())
- func IfNotPanic(f func())
- func IfPanic(f func())
- func Recover()
- func SafeCall(process string, f func())
- func Set[T any](ptr *T, val T)
- func SetResult[T any](ptr *T, f func() T)
- func Stop()
- type AssertEqInfo
- type AssertFalseInfo
- type AssertInfo
- type AssertNeqInfo
- type AssertNotInfo
- type AssertNotNilInfo
- type CaptureType
- type CommentType
- type Config
- func (config Config) Block(process string)
- func (config Config) BlockCall(process string, function any, args ...any) []any
- func (config Config) BlockCallDefer(process string, deferFunction func(), function any, args ...any) []any
- func (config Config) Recover(process string)
- func (config Config) RecoverCall(process string, function any, args ...any) []any
- func (config Config) RecoverCallDefer(process string, deferFunction func(), function any, args ...any) []any
- func (config Config) Recur(process string)
- func (config Config) RecurCall(process string, function any, args ...any) []any
- func (config Config) RecurCallDefer(process string, deferFunction func(), function any, args ...any) []any
- func (config Config) Stop(process string)
- func (config Config) StopCall(process string, function any, args ...any) []any
- func (config Config) StopCallDefer(process string, deferFunction func(), function any, args ...any) []any
- type FinallyFuncIsNilError
- type HandlePanicFunc
- type PanicHandlerEnum
- type PanicMessage
- type SpecifyBehaviorFunc
- type StackFrame
- type StackMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEq ¶
func AssertEq[T comparable](a T, b T, msg string)
func AssertFalse ¶
func AssertFalse(msg string)
func AssertNeq ¶
func AssertNeq[T comparable](a T, b T, msg string)
func AssertNotNil ¶
func CaptureResult ¶
func CaptureResult(f func() any)
func CommentResult ¶
func CommentResult(f func() string)
func IfNotPanic ¶
func IfNotPanic(f func())
Types ¶
type AssertEqInfo ¶
type AssertEqInfo[T comparable] struct { Message string Arg1, Arg2 T }
type AssertFalseInfo ¶
type AssertFalseInfo struct {
Message string
}
type AssertInfo ¶
type AssertInfo struct {
Message string
}
type AssertNeqInfo ¶
type AssertNeqInfo[T comparable] struct { Message string Arg1, Arg2 T }
type AssertNotInfo ¶
type AssertNotInfo struct {
Message string
}
type AssertNotNilInfo ¶
type CaptureType ¶
type CaptureType any
type CommentType ¶
type CommentType string
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func CreateConfig ¶
func CreateConfig(handlePanic HandlePanicFunc, specifyBehavior SpecifyBehaviorFunc) Config
func (Config) BlockCallDefer ¶
func (Config) RecoverCall ¶
func (Config) RecoverCallDefer ¶
func (Config) RecurCallDefer ¶
type FinallyFuncIsNilError ¶
type FinallyFuncIsNilError struct{}
type HandlePanicFunc ¶
type HandlePanicFunc func(PanicMessage)
type PanicHandlerEnum ¶
type PanicHandlerEnum uint
const ( BLOCK PanicHandlerEnum = iota STOP RECUR RECOVER )
type PanicMessage ¶
type PanicMessage struct { CallStack []StackFrame Err any }
func PanicMessageFromError ¶
func PanicMessageFromError(err any) *PanicMessage
func (*PanicMessage) AddMetadata ¶
func (msg *PanicMessage) AddMetadata(metadata StackMetadata)
func (*PanicMessage) AddProcess ¶
func (msg *PanicMessage) AddProcess(process string)
func (PanicMessage) Log ¶
func (msg PanicMessage) Log()
func (PanicMessage) String ¶
func (msg PanicMessage) String() string
func (PanicMessage) StringIndent ¶
func (msg PanicMessage) StringIndent(indent uint) string
type SpecifyBehaviorFunc ¶
type SpecifyBehaviorFunc func(err any, panicHandler PanicHandlerEnum) PanicHandlerEnum
type StackFrame ¶
type StackFrame struct { Process *string Metadata []StackMetadata }
type StackMetadata ¶
type StackMetadata any // CommentType | CaptureType | PanicMessage
Click to show internal directories.
Click to hide internal directories.