title: Timeout for WaitGroup.Wait()
body: <p>What is an idiomatic way to assign a timeout to <a href="https://golang.org/pkg/sync/#WaitGroup.Wait" rel="nofollow noreferrer">WaitGroup.Wait()</a> ?</p>
  <p>The reason I want to do this, is to safeguard my 'scheduler' from potentially awaiting an errant 'worker' for ever. This leads to some philosophical questions (i.e. how can the system reliably continue once it has errant workers?), but I think that's out of scope for this question.</p>
  <p>I have an answer which I'll provide. Now that I've written it down, it doesn't seem so bad but it still feels more convoluted than it ought to. I'd like to know if there's something available which is simpler, more idiomatic, or even an alternative approach which doesn't use WaitGroups.</p>