cloudfoundry/multierror

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Multierror

multierror is a simple go package that allows you to combine and present multiple errors as a single error.

Installation

Run go get github.com/cloudfoundry/multierror

How to use

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()

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.