Errs serializes and appends errors to the array.
(errs []error)
| 125 | |
| 126 | // Errs serializes and appends errors to the array. |
| 127 | func (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. |
| 148 | func (a *Array) Bool(b bool) *Array { |
nothing calls this directly
no test coverage detected