---
title: "constructor-interface-return"
description: "Detect constructors that hide a single concrete result."
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.

# constructor-interface-return

**Default severity:** `warning`

Reports only exported `New`-style constructors whose returns consistently
reveal one local concrete implementation of a non-empty local interface.
Polymorphic, standard-library, empty, and error interfaces are skipped.

## Bad

```go
func NewStore() Store {
	return &memoryStore{}
}
```

## Good

```go
func NewStore() *memoryStore {
	return &memoryStore{}
}
```

Source: https://strider.gempir.com/analyzers/constructor-interface-return/index.mdx
