1
0
mirror of https://github.com/fumiama/sched.git synced 2026-06-04 23:10:26 +08:00
Files
sched/error.go
2025-02-16 22:43:26 +09:00

25 lines
395 B
Go

package sched
import (
"strconv"
"strings"
)
// Errors parallel errors with batch index.
type Errors []error
func (errs Errors) Error() string {
sb := strings.Builder{}
for i, err := range []error(errs) {
if err == nil {
continue
}
sb.WriteByte('#')
sb.WriteString(strconv.Itoa(i))
sb.WriteByte(':')
sb.WriteString(err.Error())
sb.WriteByte(' ')
}
return sb.String()
}