---
title: "oversized-fixed-width-shift"
description: "Detect shifts that always clear fixed-width integers."
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.

# oversized-fixed-width-shift

**Default severity:** `warning`

Shifting a fixed-width integer by its full width or more always clears every
value bit. This is usually an incorrect shift count. Machine-sized `int`,
`uint`, and `uintptr` are excluded because width-dependent bit manipulation can
be intentional.

## Bad

```go
value := uint8(1) << 8
```

## Good

```go
value := uint8(1) << 7
```

Source: https://strider.gempir.com/analyzers/oversized-fixed-width-shift/index.mdx
