Run functions asynchronously, hides all magic. 100% coverage.
Your functions should have next signature:
func job(ctx context.Context) (Result, error)
Than just put your functions and context.Context
inside ExecuteAsync()
:
results, err := ExecuteAsync(ctx, job1, job2)