func (s ErrorSummaryItems) AppendSummary(buf *bytes.Buffer, prefix string) {
	maxLen := 0
	for _, item := range s {
		if len(item.Label) > maxLen {
			maxLen = len(item.Label)
		}
	}
	for idx, item := range s {
		if idx > 0 {
			buf.WriteByte('\n')
		}
		if len(item.Label) < maxLen {
			item.Label = strings.Repeat(" ", maxLen-len(item.Label)) + item.Label
		}
		item.AppendSummary(buf, prefix)
	}
}
AppendSummary implements ErrorSummary interface.
package ctxerr
import (
	"bytes"
	"strings"
	"github.com/maxatome/go-testdeep/internal/color"
	"github.com/maxatome/go-testdeep/internal/util"
)
type ErrorSummary interface {
	AppendSummary(buf *bytes.Buffer, prefix string)
}
type ErrorSummaryItem struct {
	Label       string
	Value       string
	Explanation string
}
var _ ErrorSummary = ErrorSummaryItem{}
func (s ErrorSummaryItem) AppendSummary(buf *bytes.Buffer, prefix string) {
	color.Init()
	buf.WriteString(prefix)
	buf.WriteString(color.BadOnBold)
	buf.WriteString(s.Label)
	buf.WriteString(": ")
	buf.WriteString(color.BadOn)
	util.IndentStringIn(buf, s.Value, prefix+strings.Repeat(" ", len(s.Label)+2), color.BadOn, color.BadOff)
	if s.Explanation != "" {
		buf.WriteString(color.BadOff)
		buf.WriteByte('\n')
		buf.WriteString(prefix)
		buf.WriteString(color.BadOn)
		util.IndentStringIn(buf, s.Explanation, prefix, color.BadOn, color.BadOff)
	}
	buf.WriteString(color.BadOff)
}
type ErrorSummaryItems []ErrorSummaryItem
var _ ErrorSummary = (ErrorSummaryItems)(nil)