errutil

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package errutil contains common error-related utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Multi

func Multi(errs ...error) error

Multi combines multiple errors into one:

  • If all errors are nil, it returns nil.

  • If there is one non-nil error, it is returned.

  • Otherwise, the return value is an error whose Error methods contain all the messages of all non-nil arguments.

If the input contains any error returned by Multi, such errors are flattened. The following two calls return the same value:

Multi(Multi(err1, err2), Multi(err3, err4))
Multi(err1, err2, err3, err4)

Types

This section is empty.

Jump to

Keyboard shortcuts

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