Discover Packages
github.com/256dpi/stack
package
module
Version:
v0.3.0
Opens a new window with list of versions in this module.
Published: Jan 8, 2018
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 2
Opens a new window with list of known importers.
README
README
¶
stack
Package stack provides a very small and clean API for using the built-in panic and recover functions to abort and resume execution of a goroutine.
Installation
Get the package using the go tool:
$ go get -u github.com/256dpi/stack
License
The MIT License (MIT)
Copyright (c) 2016 Joël Gähwiler
Expand ▾
Collapse ▴
Documentation
¶
Package stack provides a very small and clean API for using the built-in panic
and recover functions to abort and resume execution of a goroutine.
Abort will abort even if the supplied error is nil.
AbortIf will only abort if the supplied error is present.
func Resume(fn func(error ))
Resume will try to recover an earlier call to Abort and call fn if an error
has been recovered. It will not recover direct calls to the built-in panic
function.
Note: If the built-in panic function has been called with nil, a call to
Resume will discard that panic and continue execution.
Trace returns a formatted stack trace of the original call to Abort during
a call to Resume.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.