Name: multierror
Owner: Cloud Foundry
Description: null
Created: 2016-02-23 00:51:37.0
Updated: 2017-01-10 02:27:43.0
Pushed: 2017-01-23 20:13:27.0
Homepage: null
Size: 12
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
multierror
is a simple go package that allows you to combine and present multiple errors as a single error.
Run go get github.com/cloudfoundry/multierror
rt "github.com/cloudfoundry/multierror"
rs := multierror.MultiError{}
:= FirstFuncThatReturnsError()
:= SecondFuncThatReturnsError()
rs.Add(err1)
rs.Add(err2)
u can also add multierror structs and they will be flattened into one struct
rs2 := multierror.MultiError()
rs2.Add(err1)
rs.Add(errors2)
turns the errors as an aggregate of all the error messages
rs.Error()