2022-01-05 05:15:38 -05:00
|
|
|
package multierr
|
|
|
|
|
2025-01-04 02:29:49 -05:00
|
|
|
import (
|
|
|
|
`sync`
|
|
|
|
)
|
|
|
|
|
2022-01-05 05:15:38 -05:00
|
|
|
// MultiError is a type of error.Error that can contain multiple errors.
|
|
|
|
type MultiError struct {
|
|
|
|
// Errors is a slice of errors to combine/concatenate when .Error() is called.
|
|
|
|
Errors []error `json:"errors"`
|
|
|
|
// ErrorSep is a string to use to separate errors for .Error(). The default is "\n".
|
|
|
|
ErrorSep string `json:"separator"`
|
2025-01-04 02:29:49 -05:00
|
|
|
lock sync.Mutex
|
2022-01-05 05:15:38 -05:00
|
|
|
}
|