Err serializes and appends the err to the array.
(err error)
| 105 | |
| 106 | // Err serializes and appends the err to the array. |
| 107 | func (a *Array) Err(err error) *Array { |
| 108 | switch m := ErrorMarshalFunc(err).(type) { |
| 109 | case nil: |
| 110 | a.buf = enc.AppendNil(enc.AppendArrayDelim(a.buf)) |
| 111 | case LogObjectMarshaler: |
| 112 | a = a.Object(m) |
| 113 | case error: |
| 114 | if !isNilValue(m) { |
| 115 | a.buf = enc.AppendString(enc.AppendArrayDelim(a.buf), m.Error()) |
| 116 | } |
| 117 | case string: |
| 118 | a.buf = enc.AppendString(enc.AppendArrayDelim(a.buf), m) |
| 119 | default: |
| 120 | a.buf = enc.AppendInterface(enc.AppendArrayDelim(a.buf), m) |
| 121 | } |
| 122 | |
| 123 | return a |
| 124 | } |
| 125 | |
| 126 | // Errs serializes and appends errors to the array. |
| 127 | func (a *Array) Errs(errs []error) *Array { |
nothing calls this directly
no test coverage detected