38e35acb4e
Release 3X-UI for Docker / build (push) Has been cancelled
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
31 lines
457 B
Go
31 lines
457 B
Go
package common
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
type multiError []error
|
|
|
|
func (e multiError) Error() string {
|
|
var r strings.Builder
|
|
r.WriteString("multierr: ")
|
|
for _, err := range e {
|
|
r.WriteString(err.Error())
|
|
r.WriteString(" | ")
|
|
}
|
|
return r.String()
|
|
}
|
|
|
|
func Combine(maybeError ...error) error {
|
|
var errs multiError
|
|
for _, err := range maybeError {
|
|
if err != nil {
|
|
errs = append(errs, err)
|
|
}
|
|
}
|
|
if len(errs) == 0 {
|
|
return nil
|
|
}
|
|
return errs
|
|
}
|