---
title: "use-errors-new"
description: "Prefer errors.New for static errors."
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.

# use-errors-new

<!-- Code generated by docs/scripts/generate-check-docs.go; DO NOT EDIT. -->

**Default severity:** `warning`

Prefer errors.New for static errors.

## Bad

```go
fmt.Errorf("not found")
```

## Good

```go
errors.New("not found")
```

Source: https://strider.gempir.com/lints/use-errors-new/index.mdx
