To stop ticker explicitly
maliyan opened this issue · 1 comments
maliyan commented
10.1 #75 Providing a wrong time duration should stop ticker, or cause leaks
ticker := time.NewTicker(1000) // should stop defer
for {
select {
case <-ticker.C:
// Do something
}
}
ticker := time.NewTicker(1000)
defer ticker.Stop()
for {
select {
case <-ticker.C:
// Do something
}
}
teivah commented
Thanks but this code is an excerpt (we don't see the whole function) and don't focus on the ticker so I don't consider it an issue.