type NestingMatcher … type NestedError … func (e *NestedError) Error() string { … } // Create a NestedError with the given path. // If err is a NestedError, prepend the path to it. // If err is an AggregateError, recursively Nest each error. func Nest(path string, err error) error { … } type AggregateError … // Error is part of the error interface. func (err AggregateError) Error() string { … }