wisski-cloud-distillery/pkg/errorx/errorx.go
2022-10-04 13:27:55 +02:00

11 lines
195 B
Go

package errorx
// First returns the first non-nil error, or nil otherwise.
func First(errors ...error) error {
for _, err := range errors {
if err != nil {
return err
}
}
return nil
}