stack

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: MIT Imports: 1 Imported by: 2

README

stack

Build Status Coverage Status GoDoc Release Go Report Card

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

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(err error)

Abort will abort even if the supplied error is nil.

func AbortIf

func AbortIf(err error)

AbortIf will only abort if the supplied error is present.

func Resume

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.

func Trace

func Trace() string

Trace returns a formatted stack trace of the original call to Abort during a call to Resume.

Types

This section is empty.

Jump to

Keyboard shortcuts

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