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