()
| 162 | type errorSlice []error |
| 163 | |
| 164 | func (errs errorSlice) Error() string { |
| 165 | switch len(errs) { |
| 166 | case 0: |
| 167 | return "" |
| 168 | case 1: |
| 169 | // Return the formatted error string for a single error. |
| 170 | return formatErrorForGitHub(errs[0]) |
| 171 | default: |
| 172 | var b strings.Builder |
| 173 | b.WriteString("multiple errors:\n") |
| 174 | for _, err := range errs { |
| 175 | formattedError := formatErrorForGitHub(err) |
| 176 | b.WriteString(formattedError + "\n") |
| 177 | } |
| 178 | return b.String() |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | // formatErrorForGitHub formats an error for GitHub annotations. |
| 183 | func formatErrorForGitHub(err error) string { |
nothing calls this directly
no test coverage detected