@@ -14,7 +14,7 @@ import (
1414//
1515// The index of the function will be -1 if all functions have been completed without error or
1616// panic.
17- func All (funcs ... func (context. Context ) error ) (int , error ) {
17+ func All (funcs ... AsyncFn ) (int , error ) {
1818 return all (context .Background (), funcs ... )
1919}
2020
@@ -25,13 +25,13 @@ func All(funcs ...func(context.Context) error) (int, error) {
2525//
2626// The index of the function will be -1 if all functions have been completed without error or
2727// panic, or the context has been canceled (or timeout) before all functions finished.
28- func AllWithContext (ctx context.Context , funcs ... func (context. Context ) error ) (int , error ) {
28+ func AllWithContext (ctx context.Context , funcs ... AsyncFn ) (int , error ) {
2929 return all (ctx , funcs ... )
3030}
3131
3232// all executes the functions asynchronously until all functions have been finished, or the context
3333// is done (canceled or timeout).
34- func all (parent context.Context , funcs ... func (context. Context ) error ) (int , error ) {
34+ func all (parent context.Context , funcs ... AsyncFn ) (int , error ) {
3535 if len (funcs ) == 0 {
3636 return - 1 , nil
3737 }
@@ -88,7 +88,7 @@ func all(parent context.Context, funcs ...func(context.Context) error) (int, err
8888// AllCompleted executes the functions asynchronously until all functions have been finished. It
8989// will return an error slice that is ordered by the functions order, and a boolean value to
9090// indicate whether any functions return an error or panic.
91- func AllCompleted (funcs ... func (context. Context ) error ) ([]error , bool ) {
91+ func AllCompleted (funcs ... AsyncFn ) ([]error , bool ) {
9292 return allCompleted (context .Background (), funcs ... )
9393}
9494
@@ -98,7 +98,7 @@ func AllCompleted(funcs ...func(context.Context) error) ([]error, bool) {
9898// error or panic.
9999func AllCompletedWithContext (
100100 ctx context.Context ,
101- funcs ... func (context. Context ) error ,
101+ funcs ... AsyncFn ,
102102) ([]error , bool ) {
103103 return allCompleted (ctx , funcs ... )
104104}
@@ -107,7 +107,7 @@ func AllCompletedWithContext(
107107// the context is done (canceled or timeout).
108108func allCompleted (
109109 parent context.Context ,
110- funcs ... func (context. Context ) error ,
110+ funcs ... AsyncFn ,
111111) (errs []error , hasError bool ) {
112112 hasError = false
113113 errs = make ([]error , len (funcs ))
0 commit comments