Documentation
¶
Overview ¶
Package errutil provides utility functions related to error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorStack ¶
type ErrorStack struct {
Errors []error
}
ErrorStack contains multiple non-nil errors.
func NewErrorStack ¶
func NewErrorStack(err error) *ErrorStack
NewErrorStack creates new ErrorStack. if given error is not nil, it will pushed.
func (*ErrorStack) First ¶
func (e *ErrorStack) First() error
First returns first pushed non-nil error.
func (*ErrorStack) Push ¶
func (e *ErrorStack) Push(err error)
Push pushes given error to stack if not nil.
func (*ErrorStack) PushBool ¶
func (e *ErrorStack) PushBool(b bool, str string)
PushBool pushes new error with given string if given bool is true.
Click to show internal directories.
Click to hide internal directories.