errorgroup

package module
v0.0.0-...-8f39fc5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: MIT Imports: 1 Imported by: 1

README

GoDoc Codeship Codecov Go Report Card

Error Group

ErrorGroup is an error type that can hold other errors together.

Installation

go get -u github.com/txgruppi/errorgroup

Why?

Sometimes I have a loop running functions in parallel and because of the existing API of most the Go libs I need to return only one error.

I don't want to throw away such important information, so I group them together.

Tests

go get -u -t github.com/txgruppi/errorgroup-go
cd $GOPATH/src/github.com/txgruppi/errorgroup-go
go test ./...

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorGroup

type ErrorGroup struct {
	Errors []error
}

ErrorGroup is used to group several errors together

func New

func New(errs []error) *ErrorGroup

New creates a new ErrorGroup with the given errors

func (*ErrorGroup) Error

func (e *ErrorGroup) Error() string

Error returns all the error messages joined by a new line character

Jump to

Keyboard shortcuts

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