---
title: "time-value-equality"
description: "Compare time.Time values with Time.Equal."
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.

# time-value-equality

**Default severity:** `warning`

The `==` and `!=` operators compare every field of `time.Time`, including
monotonic-clock and location representation details. `Time.Equal` compares the
represented instants.

## Bad

```go
if first == second {
	match()
}
```

## Good

```go
if first.Equal(second) {
	match()
}
```

Source: https://strider.gempir.com/analyzers/time-value-equality/index.mdx
