VictoriaMetrics/app/vmalert/notifier/utils.go

22 lines
291 B
Go
Raw Normal View History

2020-04-27 23:19:27 +02:00
package notifier
import (
"fmt"
"strings"
)
type errGroup struct {
errs []string
}
func (eg *errGroup) err() error {
if eg == nil || len(eg.errs) == 0 {
return nil
}
return eg
}
func (eg *errGroup) Error() string {
return fmt.Sprintf("errors:%s", strings.Join(eg.errs, "\n"))
}