MCPcopy Create free account
hub / github.com/IBM/sarama / MultiErrorFormat

Function MultiErrorFormat

errors.go:110–123  ·  view source on GitHub ↗

MultiErrorFormat specifies the formatter applied to format multierrors. Deprecated: Please use [errors.Join] instead.

(es []error)

Source from the content-addressed store, hash-verified

108//
109// Deprecated: Please use [errors.Join] instead.
110func MultiErrorFormat(es []error) string {
111 if len(es) == 1 {
112 return es[0].Error()
113 }
114
115 points := make([]string, len(es))
116 for i, err := range es {
117 points[i] = fmt.Sprintf("* %s", err)
118 }
119
120 return fmt.Sprintf(
121 "%d errors occurred:\n\t%s\n",
122 len(es), strings.Join(points, "\n\t"))
123}
124
125type sentinelError struct {
126 sentinel error

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected