diff --git a/format.go b/format.go index 47f13c4..0679e7a 100644 --- a/format.go +++ b/format.go @@ -9,6 +9,9 @@ import ( // turn the list of errors into a string. type ErrorFormatFunc func([]error) string +// DefaultErrorFormatFunc is the default ErrorFormatFunc +var DefaultErrorFormatFunc = ListFormatFunc + // ListFormatFunc is a basic formatter that outputs the number of errors // that occurred along with a bullet point list of the errors. func ListFormatFunc(es []error) string { diff --git a/multierror.go b/multierror.go index f545743..de861a8 100644 --- a/multierror.go +++ b/multierror.go @@ -15,7 +15,7 @@ type Error struct { func (e *Error) Error() string { fn := e.ErrorFormat if fn == nil { - fn = ListFormatFunc + fn = DefaultErrorFormatFunc } return fn(e.Errors)