Error implements the Error interface.
()
| 157 | |
| 158 | // Error implements the Error interface. |
| 159 | func (self ErrorList) Error() string { |
| 160 | switch len(self) { |
| 161 | case 0: |
| 162 | return "no errors" |
| 163 | case 1: |
| 164 | return self[0].Error() |
| 165 | } |
| 166 | return fmt.Sprintf("%s (and %d more errors)", self[0].Error(), len(self)-1) |
| 167 | } |
| 168 | |
| 169 | // Err returns an error equivalent to this ErrorList. |
| 170 | // If the list is empty, Err returns nil. |