Skip to content

Instantly share code, notes, and snippets.

@gkampitakis
Created February 18, 2024 14:19
Show Gist options
  • Save gkampitakis/0cb9690f5e8c265e90a7cdc25a6d0137 to your computer and use it in GitHub Desktop.
Save gkampitakis/0cb9690f5e8c265e90a7cdc25a6d0137 to your computer and use it in GitHub Desktop.
Memory leaks in Go - Not stopping time.Ticker
func main() {
for {
ticker := time.NewTicker(1 * time.Second)
// do something with the ticker
_ = <-ticker.C
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment