Wait result of multiple goroutines

前端 未结 3 1726
走了就别回头了
走了就别回头了 2021-01-11 21:01

I am searching a way to execute asynchronously two functions in go which returns different results and errors, wait for them to finish and print both results. Also if one of

3条回答
  •  囚心锁ツ
    2021-01-11 21:49

    I think here sync.WaitGroup can be used. It can waits for different and dynamic number of goroutines.

提交回复
热议问题