---
title: "partially-typed-constant-group"
description: "Detect constant groups where only the first explicit value has a type."
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.

# partially-typed-constant-group

**Default severity:** `warning`

In a constant group, an explicit type is inherited only when a later
declaration omits its value. If every declaration has an explicit literal but
only the first has a type, later constants silently use default built-in types
and may lose methods or assignment compatibility.

## Bad

```go
const ( first Kind = 1; second = 2 )
```

## Good

```go
const ( first Kind = 1; second Kind = 2 )
```

Source: https://strider.gempir.com/analyzers/partially-typed-constant-group/index.mdx
