internal/component: Move Pool into lazy package

This commit is contained in:
Tom Wiesing 2022-10-17 13:08:42 +02:00
parent bcfd0765b0
commit 7c3c84e116
No known key found for this signature in database
8 changed files with 261 additions and 139 deletions

View file

@ -1,11 +1,8 @@
package errorx
import "github.com/tkw1536/goprogram/lib/collection"
// 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
return collection.First(errors, func(err error) bool { return err != nil })
}