mirror of
https://github.com/danog/gojekyll.git
synced 2024-11-27 00:34:42 +01:00
22 lines
316 B
Go
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"))
|
|
}
|
|
}
|