elvish/edit/after.go
2015-02-26 15:31:21 +01:00

13 lines
236 B
Go

package edit
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)
}