goodtimer
goodtimer copied to clipboard
Using GoodTimer in a select?
This library seems great (I'm sick of the confusing time.Timer API), but reading the Godoc, it doesn't seem possible to wait on this timer in a select statement. Something like
gt := goodtimer.New(2 * time.Second)
select {
case <-workDone:
case <-gt.Expired():
fmt.Println("timeout completing work")
}