1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-30 07:18:59 +01:00
gojekyll/site/errors.go

22 lines
316 B
Go
Raw Permalink Normal View History

package site
import (
"fmt"
"strings"
)
func combineErrors(errs []error) error {
switch len(errs) {
case 0:
return nil
case 1:
return errs[0]
default:
messages := make([]string, len(errs))
for i, e := range errs {
messages[i] = e.Error()
}
return fmt.Errorf(strings.Join(messages, "\n"))
}
}