safe

package
v0.0.0-...-9320ea3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRecoverFromPanic = errors.New("recover from panic")

Functions

func SafeGo

func SafeGo(fn func())

SafeGo spawns a go-routine to run {#fn} with panic handler.

func Try

func Try(fn func()) (err error)

Try invokes #{fn} with panic handler. If #{fn} causes a panic, #{ErrRecoverFromPanic} will be returned. Otherwise, nil will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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