Documentation
¶
Overview ¶
Package utils provides several helper function for golang.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorStack ¶ added in v1.0.2
type ErrorStack struct {
// contains filtered or unexported fields
}
ErrorStack handles a collection of errors. Usefull e.g. in loop where you want to get a list of all occured errors.
func NewErrorStack ¶ added in v1.0.2
func NewErrorStack() *ErrorStack
NewErrorStack returns a new, empty error stack.
func (*ErrorStack) Append ¶ added in v1.0.2
func (stack *ErrorStack) Append(err error)
Append will add passed error to internal list if it's no nil.
func (*ErrorStack) AsError ¶ added in v1.0.2
func (stack *ErrorStack) AsError() error
AsError returns nil of there's no error in internal stack or a new erros which contains all existing errors, composed by new line.
func (*ErrorStack) Error ¶ added in v1.0.2
func (stack *ErrorStack) Error() string
Error used to fulfill error interface. Returns all existing errors composed by new line or an empty string.
Click to show internal directories.
Click to hide internal directories.