errors

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: MIT Imports: 7 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target interface{}) bool

func Is

func Is(err, target error) bool

func New

func New(s string, args ...interface{}) error

func Unwrap

func Unwrap(err error) error

Types

type Frame

type Frame struct {
	// contains filtered or unexported fields
}

Heavily based on github.com/pkg/errors.Frame

func Here

func Here() *Frame

func StackFrame

func StackFrame(skip int) *Frame

func (Frame) Format

func (f Frame) Format(s fmt.State, verb rune)

Format formats the frame according to the fmt.Formatter interface.

%s    source file
%d    source line
%n    function name
%v    equivalent to %s:%d

Format accepts flags that alter the printing of some verbs, as follows:

%+s   function name and path of source file relative to the compile time
      GOPATH separated by \n\t (<funcname>\n\t<path>)
%+n   full package name followed by function name
%+v   equivalent to %+s:%d

func (Frame) Name

func (f Frame) Name() string

type Stack

type Stack []Frame

func BackTrace

func BackTrace(skip int) Stack

func (Stack) Format

func (st Stack) Format(s fmt.State, verb rune)

Jump to

Keyboard shortcuts

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