errors

package
v0.0.0-...-893bab6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(errs ...error) error

Join returns an error that wraps the given errors. Any nil error values are discarded. Join returns nil if every value in errs is nil. Copied from the golang standard library at https://github.com/golang/go/blob/a5339da341b8f37c87b77c2fc1318d6ecd2331ff/src/errors/join.go#L19 Copyright (c) 2009 The Go Authors. All rights reserved.

The difference with the above implementation resides in how this error formats. The former uses new lines to concatenate errors which is an inconvenience. This implementation formats as the concatenation of the strings obtained by calling the Error method of each element of errs, recursively unwrapping them if necessary, separated by commas and surrounded by brackets.

This is similar as to how the k8s.io apimachinery aggregate error format. However this error is simpler and supports the full wrapping semantics, while k8s.io apimachinery aggregate error doesn't support the 'errors.As'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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