func Errors(err error) []error {
	if eg, ok := err.(ErrorGroup); ok {
		return eg.Errors()
	}
	return []error{err}
}
Errors uses the ErrorGroup interface to return a slice of errors.
If the ErrorGroup interface is not implemented it returns an array containing just the given error.
package errors
type ErrorGroup interface {
	Errors() []error
}