1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-15 18:22:27 +08:00

feat: complete promise Any function

This commit is contained in:
dudaodong
2023-03-16 15:59:06 +08:00
parent 3d8f1be212
commit 930bb9c839

View File

@@ -8,6 +8,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"sync" "sync"
"github.com/duke-git/lancet/v2/internal"
) )
// Promise represents the eventual completion (or failure) of an asynchronous operation and its resulting value. // Promise represents the eventual completion (or failure) of an asynchronous operation and its resulting value.
@@ -267,9 +269,10 @@ func Any[T any](promises ...*Promise[T]) *Promise[T] {
} }
errCombo := errs[0] errCombo := errs[0]
// for _, err := range errs[1:] { for _, err := range errs[1:] {
// errCombo = errors. errCombo = internal.JoinError(err)
// } }
reject(errCombo) reject(errCombo)
}) })
} }