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 { func Tick(d time.Duration) <-chan time.Time {
ch := make(chan time.Time) ch := make(chan time.Time)
go func() { go func() {
for {
time.Sleep(d) time.Sleep(d)
ch <- time.Now() ch <- time.Now()
}
}() }()
return ch return ch
} }