1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-26 20:54:48 +01:00
gojekyll/site/errors.go
2017-08-10 11:18:36 -04:00

22 lines
316 B
Go

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"))
}
}