Open jdef opened 9 years ago
Base on previous experience and https://groups.google.com/forum/#!topic/golang-nuts/A597Btr_0P8 - it's usually advisable to avoid use of time.After in a switch statement. Instead, create a new time.Timer before the loop and make sure it gets closed when the switch exits.
we want to avoid leaking goroutines if we can help it. use of
time.After
is probably ok in some places, and perhaps should be re-implemented using timers in others: we'll have to evaluate on a case-by-case basis.