runtime

package
v0.0.61 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 10 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 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 GetShortCaller

func GetShortCaller() string

func GoroutineID added in v0.0.61

func GoroutineID() uint64

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.

Jump to

Keyboard shortcuts

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