Add adds the error to the error list if it is not nil.
(err error)
| 13 | |
| 14 | // Add adds the error to the error list if it is not nil. |
| 15 | func (es *MultiError) Add(err error) { |
| 16 | if err == nil { |
| 17 | return |
| 18 | } |
| 19 | if merr, ok := err.(nonNilMultiError); ok { |
| 20 | *es = append(*es, merr...) |
| 21 | } else { |
| 22 | *es = append(*es, err) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // Err returns the error list as an error or nil if it is empty. |
| 27 | func (es MultiError) Err() error { |
no outgoing calls
no test coverage detected