---
title: "invalid-struct-tag"
description: "Validate struct tag syntax, duplicate keys, and standard options."
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.

# invalid-struct-tag

Detect malformed struct tags before reflection or encoding packages
silently ignore them.

**Default severity:** `error`

## Behavior

The rule validates quoted key-value syntax, duplicate keys, whitespace and
quoting in common tag names, and JSON/XML options. Duplicate keys are reported
consistently regardless of which packages the file imports.

## Bad

```go
type User struct {
	Name string `json:name`
}
```

## Good

```go
type User struct {
	Name string `json:"name"`
}
```

Source: https://strider.gempir.com/lints/invalid-struct-tag/index.mdx
