---
title: "nested-structs"
description: "Discourage anonymous nested struct types."
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.

# nested-structs

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

**Default severity:** `note`

Discourage anonymous nested struct types.

## Bad

```go
type User struct { Address struct { City string } }
```

## Good

```go
type Address struct { City string }
type User struct { Address Address }
```

Source: https://strider.gempir.com/lints/nested-structs/index.mdx
