Fix Tick example in slides

This commit is contained in:
Fedor Korotkiy 2021-03-04 18:10:30 +00:00
parent 188819ffa5
commit dec78a3841

View file

@ -361,8 +361,10 @@
func Tick(d time.Duration) <-chan time.Time {
ch := make(chan time.Time)
go func() {
time.Sleep(d)
ch <- time.Now()
for {
time.Sleep(d)
ch <- time.Now()
}
}()
return ch
}