diff --git a/format.go b/format.go index bb65a12..48c770b 100644 --- a/format.go +++ b/format.go @@ -21,3 +21,6 @@ func ListFormatFunc(es []error) string { "%d error(s) occurred:\n\n%s", len(es), strings.Join(points, "\n")) } + +// DefaultErrorFormatFunc is global default ErrorFormatFunc +var DefaultErrorFormatFunc ErrorFormatFunc = ListFormatFunc diff --git a/multierror.go b/multierror.go index 2ea0827..2f037e2 100644 --- a/multierror.go +++ b/multierror.go @@ -14,7 +14,7 @@ type Error struct { func (e *Error) Error() string { fn := e.ErrorFormat if fn == nil { - fn = ListFormatFunc + fn = DefaultErrorFormatFunc } return fn(e.Errors)