runtime

package
v0.0.98 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PanicHandlers = []func(interface{}){logPanic}

PanicHandlers is a list of functions which will be invoked when a panic happens.

Functions

func FormatStack added in v0.0.95

func FormatStack() ([]byte, error)

func GetCallStackTrace added in v0.0.60

func GetCallStackTrace() string

func GetCaller

func GetCaller() string

func GetCallerWithSkip

func GetCallerWithSkip(skip int) string

GetCaller returns the caller of the function that calls it. The argument skip is the number of stack frames to skip before recording in pc, with 0 identifying the frame for Callers itself and 1 identifying the caller of Callers

func GetMetadata added in v0.0.90

func GetMetadata(ctx context.Context, key string) []string

func GetShortCaller

func GetShortCaller() string

func GoroutineID added in v0.0.61

func GoroutineID() uint64

low performance

func Must added in v0.0.80

func Must(err error)

Must panics on non-nil errors. Useful to handling programmer level errors

func NameOfFunction added in v0.0.74

func NameOfFunction(f interface{}) string

func Recover added in v0.0.60

func Recover()

must use defer Recover() not effective for calling defer func() {Recover()}()

func RecoverFromPanic added in v0.0.60

func RecoverFromPanic(err *error)

RecoverFromPanic replaces the specified error with an error containing the original error, and the call tree when a panic occurs. This enables error handlers to handle errors and panics the same way.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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