1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-23 13:52:26 +08:00

test: add unit test for promise Race and Any function

This commit is contained in:
dudaodong
2023-03-17 13:59:18 +08:00
parent 3f6aef1432
commit 8f0c60cade
2 changed files with 120 additions and 3 deletions

View File

@@ -237,7 +237,7 @@ func Race[T any](promises []*Promise[T]) *Promise[T] {
// Any resolves as soon as any of the input's Promises resolve, with the value of the resolved Promise.
// Any rejects if all of the given Promises are rejected with a combination of all errors.
func Any[T any](promises ...*Promise[T]) *Promise[T] {
func Any[T any](promises []*Promise[T]) *Promise[T] {
if len(promises) == 0 {
return nil
}