Wait will block until all goroutines spawned with Go exit and will propagate any panics spawned in a child goroutine.
()
| 36 | // Wait will block until all goroutines spawned with Go exit and will |
| 37 | // propagate any panics spawned in a child goroutine. |
| 38 | func (h *WaitGroup) Wait() { |
| 39 | h.wg.Wait() |
| 40 | |
| 41 | // Propagate a panic if we caught one from a child goroutine. |
| 42 | h.pc.Repanic() |
| 43 | } |
| 44 | |
| 45 | // WaitAndRecover will block until all goroutines spawned with Go exit and |
| 46 | // will return a *panics.Recovered if one of the child goroutines panics. |