errs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector collects multiple errors, allowing for deferred error handling and propagation.

func NewCollector

func NewCollector() *Collector

NewCollector creates a new error Collector.

func (*Collector) Add

func (c *Collector) Add(err error)

Add an error to the Collector.

If an error collector is being added to this one, all errors which it has accumulated are copied into this collector.

func (*Collector) Count

func (c *Collector) Count() int

Count the number of errors currently collected.

func (*Collector) Error

func (c *Collector) Error() string

Error returns the error string for the collector.

func (*Collector) HasErrors

func (c *Collector) HasErrors() bool

HasErrors checks whether the collector has any errors added.

Jump to

Keyboard shortcuts

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