internal/component: Move Pool into lazy package
This commit is contained in:
parent
bcfd0765b0
commit
7c3c84e116
8 changed files with 261 additions and 139 deletions
|
|
@ -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 })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue