errorset

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorSet

type ErrorSet []error

ErrorSet replaces the "error" return value in functions that can return multiple errors. It provides convenience functions for easily adding errors to the set.

func (*ErrorSet) Add

func (errs *ErrorSet) Add(err error)

Add adds the given error to the set if it is non-nil.

func (*ErrorSet) Addf

func (errs *ErrorSet) Addf(msg string, args ...any)

Addf is a shorthand for errs.Add(fmt.Errorf(...)).

func (*ErrorSet) Append

func (errs *ErrorSet) Append(other ErrorSet)

Append adds all errors from the `other` ErrorSet to this one.

func (ErrorSet) IsEmpty

func (errs ErrorSet) IsEmpty() bool

IsEmpty returns true if no errors are in the set.

func (ErrorSet) Join

func (errs ErrorSet) Join(sep string) string

Join joins the messages of all errors in this set using the provided separator. If the set is empty, an empty string is returned.

Jump to

Keyboard shortcuts

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