appenderr

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: MIT Imports: 7 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendErr

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

AppendErr a helper error struct that counts and removes duplicates errors. errors are considered identical if their error signature is the same.

func New

func New() *AppendErr

New AppendErr

func (*AppendErr) Add

func (e *AppendErr) Add(err error)

Add an error to stack, appendErr will ignore nil errors

func (*AppendErr) Addf

func (e *AppendErr) Addf(format string, args ...interface{})

Addf creates an error using fmt.Errorf and adds it to the error list

func (*AppendErr) ErrOrNil

func (e *AppendErr) ErrOrNil() error

ErrOrNil returns itself if errors are found or nil

func (*AppendErr) Error

func (e *AppendErr) Error() (s string)

func (*AppendErr) Wrap added in v0.2.0

func (e *AppendErr) Wrap(err error, message string)

Wrap an error message and add it to the error list. see errors.Wrap

func (*AppendErr) Wrapf added in v0.2.0

func (e *AppendErr) Wrapf(err error, format string, args ...interface{})

Wrapf wrap an error message with a formated message see errors.Wrapf

Jump to

Keyboard shortcuts

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