Movatterモバイル変換


[0]ホーム

URL:


multierr

package
v1.92.3Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License:BSD-3-ClauseImports:3Imported by:53

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package multierr provides a simple multiple-error type.It was inspired by github.com/go-multierror/multierror.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcNew

func New(errs ...error)error

New returns an error composed from errs.Some errors in errs get special treatment:

  • nil errors are discarded
  • errors of type Error are expanded into the top level

If the resulting slice has length 0, New returns nil.If the resulting slice has length 1, New returns that error.If the resulting slice has length > 1, New returns that slice as an Error.

funcRangeadded inv1.36.0

func Range(errerror, fn func(error)bool)bool

Range performs a pre-order, depth-first iteration of the error treeby successively unwrapping all error values.For each iteration it calls fn with the current error value andstops iteration if it ever reports false.

Types

typeError

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

An Error represents multiple errors.

func (Error)As

func (eError) As(targetany)bool

As finds the first error in e that matches target, and if any is found,sets target to that error value and returns true. Otherwise, it returns false.

func (Error)Error

func (eError) Error()string

Error implements the error interface.

func (Error)Errors

func (eError) Errors() []error

Errors returns a slice containing all errors in e.

func (Error)Is

func (eError) Is(targeterror)bool

Is reports whether any error in e matches target.

func (Error)Unwrapadded inv1.38.0

func (eError) Unwrap() []error

Unwrap returns the underlying errors as-is.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp