()
| 234 | } |
| 235 | |
| 236 | func (w *ErrorWaiter) Wait() error { |
| 237 | w.waitOnce.Do(func() { |
| 238 | var ok bool |
| 239 | w.cachedError, ok = <-w.c |
| 240 | if !ok { |
| 241 | panic("unexpected channel close") |
| 242 | } |
| 243 | }) |
| 244 | return w.cachedError |
| 245 | } |
| 246 | |
| 247 | func (w *ErrorWaiter) RequireSuccess() { |
| 248 | require.NoError(w.t, w.Wait()) |
no test coverage detected