func FilterOut(err error, fns ...Matcher) error {
	if err == nil {
		return nil
	}
	if agg, ok := err.(Aggregate); ok {
		return NewAggregate(filterErrors(agg.Errors(), fns...))
	}
	if !matchesError(err, fns...) {
		return err
	}
	return nil
}
FilterOut removes all errors that match any of the matchers from the input
error.  If the input is a singular error, only that error is tested.  If the
input implements the Aggregate interface, the list of errors will be
processed recursively.

This can be used, for example, to remove known-OK errors (such as io.EOF or
os.PathNotFound) from a list of errors.
package errors
import "fmt"
type Aggregate interface {
	error
	Errors() []error
}
func NewAggregate(errlist []error) Aggregate {
	if len(errlist) == 0 {
		return nil
	}
	return aggregate(errlist)
}
type aggregate []error
func (agg aggregate) Error() string {
	if len(agg) == 0 {
		return ""
	}
	if len(agg) == 1 {
		return agg[0].Error()
	}
	result := fmt.Sprintf("[%s", agg[0].Error())
	for i := 1; i < len(agg); i++ {
		result += fmt.Sprintf(", %s", agg[i].Error())
	}
	result += "]"
	return result
}
func (agg aggregate) Errors() []error {
	return []error(agg)
}
type Matcher func(error) bool