mirror of
https://github.com/smallnest/rpcx.git
synced 2025-10-25 00:50:24 +08:00
19 lines
387 B
Go
19 lines
387 B
Go
package errors
|
|
|
|
import "fmt"
|
|
|
|
// MultiError holds multiple errors
|
|
type MultiError struct {
|
|
Errors []error
|
|
}
|
|
|
|
// Error returns the message of the actual error
|
|
func (e *MultiError) Error() string {
|
|
return fmt.Sprintf("%v", e.Errors)
|
|
}
|
|
|
|
// NewMultiError creates and returns an Error with error splice
|
|
func NewMultiError(errors []error) *MultiError {
|
|
return &MultiError{Errors: errors}
|
|
}
|