Conditions | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | package errors |
||
18 | func (e *MultiError) Error() string { |
||
19 | 3 | if len(e.errs) == 1 { |
|
20 | 1 | return e.errs[0].Error() |
|
21 | } |
||
22 | |||
23 | 2 | msg := make([]string, len(e.errs)) |
|
24 | 2 | for i, err := range e.errs { |
|
25 | 4 | msg[i] = err.Error() |
|
26 | } |
||
27 | |||
28 | 2 | return fmt.Sprintf("%d errors occurred:\n %s", len(e.errs), strings.Join(msg, "\n ")) |
|
29 | } |
||
61 |