errors

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errors provides a toolset to join and split errors.

err := errors.PrefixedGroup("my group: ", fmt.Errorf("error1), nil, fmt.Errorf("error2"))
errs := errors.Collection(err) // []errors{error("my group: error1"), error("my group: error2")}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection(err error) []error

func Group

func Group(errs ...error) error

Group joins provided errors. It ignores nil nil-values. It may return nil, when there are not errors given.

func PrefixedGroup

func PrefixedGroup(prefix string, errs ...error) error

PrefixedGroup joins error the same way as Group, and adds a prefix to the group.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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