MCPcopy
hub / github.com/rs/zerolog / Errs

Method Errs

array.go:127–145  ·  view source on GitHub ↗

Errs serializes and appends errors to the array.

(errs []error)

Source from the content-addressed store, hash-verified

125
126// Errs serializes and appends errors to the array.
127func (a *Array) Errs(errs []error) *Array {
128 for _, err := range errs {
129 switch m := ErrorMarshalFunc(err).(type) {
130 case nil:
131 a = a.Interface(nil)
132 case LogObjectMarshaler:
133 a = a.Object(m)
134 case error:
135 if !isNilValue(m) {
136 a = a.Str(m.Error())
137 }
138 case string:
139 a = a.Str(m)
140 default:
141 a = a.Interface(m)
142 }
143 }
144 return a
145}
146
147// Bool appends the val as a bool to the array.
148func (a *Array) Bool(b bool) *Array {

Callers

nothing calls this directly

Calls 5

InterfaceMethod · 0.95
ObjectMethod · 0.95
StrMethod · 0.95
isNilValueFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected