---
title: "error-type-naming"
description: "Name error implementations with an Error suffix."
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.

# error-type-naming

**Default severity:** `warning`

Named types whose value or pointer method set implements `error` should end in
`Error`, making their role recognizable at API boundaries and in type
assertions.

## Bad

```go
type ParseFailure struct {
	Offset int
}

func (ParseFailure) Error() string { return "parse failed" }
```

## Good

```go
type ParseError struct {
	Offset int
}

func (ParseError) Error() string { return "parse failed" }
```

Source: https://strider.gempir.com/analyzers/error-type-naming/index.mdx
