Append adds an error to the set. If err is a *MultiError, the inner errors are added to the set individually
(err error)
| 314 | // Append adds an error to the set. If err is a *MultiError, the inner errors are added to |
| 315 | // the set individually |
| 316 | func (me *MultiError) Append(err error) *MultiError { |
| 317 | if me == nil { |
| 318 | me = &MultiError{ |
| 319 | Errors: make([]error, 0), |
| 320 | } |
| 321 | } |
| 322 | switch typedErr := err.(type) { |
| 323 | case nil: |
| 324 | return me |
| 325 | case *MultiError: |
| 326 | for _, e := range typedErr.Errors { |
| 327 | me.Errors = append(me.Errors, e) |
| 328 | } |
| 329 | default: |
| 330 | me.Errors = append(me.Errors, err) |
| 331 | } |
| 332 | return me |
| 333 | } |
| 334 | |
| 335 | // Error implements the error interface, and formats the errors one per line |
| 336 | func (me *MultiError) Error() string { |
no outgoing calls