---
title: "leaky-time-tick"
description: "Detect time.Tick calls that leak on older Go versions."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# leaky-time-tick

**Default severity:** `warning`

Before Go 1.23, an unreferenced ticker could not be reclaimed unless it was
stopped. Because `time.Tick` does not expose the ticker, returning functions
should use `time.NewTicker` and stop it when they are finished.

Go 1.23 and newer can reclaim unreferenced tickers, so this check does not
report projects targeting those versions. Tests, `main` packages, and endless
functions are also accepted.

## Bad

```go
ticks := time.Tick(time.Second)
```

## Good

```go
ticker := time.NewTicker(time.Second)
defer ticker.Stop()
```

Source: https://strider.gempir.com/analyzers/leaky-time-tick/index.mdx
