func (r *Reporter) Add(format string, a ...interface{}) bool {
	if format == "" && len(a) == 0 {
		return false
	}
	if len(a) > 0 {
		f := a[0]
		if e, ok := f.(interface {
			Error() string
		}); ok {
			if e.Error() == "" {
				return false
			}
		}
	}
	r.mu.Lock()
	r.wrapper = r.wrapper.Append(format, a...)
	r.mu.Unlock()
	return true
}
Add adds a formatted message as an error to the error stack.

Returns true if this "err" is not nil and it's added to the reporter's stack.
package errors
import (
	"sync"
)
type StackError interface {
	Stack() []Error
	Error() string
}
func PrintAndReturnErrors(err error, printer func(string, ...interface{})) error {
	if err == nil || err.Error() == "" {
		return nil
	}
	if stackErr, ok := err.(StackError); ok {
		if len(stackErr.Stack()) == 0 {
			return nil
		}
		stack := stackErr.Stack()
		for _, e := range stack {
			if e.HasStack() {
				for _, es := range e.Stack {
					printer("%v", es)
				}
				continue
			}
			printer("%v", e)
		}
		return stackErr
	}
	printer("%v", err)
	return err
}
type Reporter struct {
	mu      sync.Mutex
	wrapper Error
}
func NewReporter() *Reporter {
	return &Reporter{wrapper: New("")}
}
func (r *Reporter) AddErr(err error) bool {
	if err == nil {
		return false
	}
	if stackErr, ok := err.(StackError); ok {
		r.addStack(stackErr.Stack())
	} else {
		r.mu.Lock()
		r.wrapper = r.wrapper.AppendErr(err)
		r.mu.Unlock()
	}
	return true
}