elvish/util/after.go
Cheer Xiao 0624368bcc Use util.AsyncReader to build a new async edit.Reader
Now we can start really dealing with signals!
2014-03-10 21:22:54 +08:00

13 lines
236 B
Go

package util
import "time"
// After is like time.After, except that it interpretes negative Duration as
// "forever".
func After(d time.Duration) <-chan time.Time {
if d < 0 {
return make(chan time.Time)
}
return time.After(d)
}