---
title: "decimal-file-mode"
description: "Detect decimal file modes that look like octal permissions."
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.

# decimal-file-mode

**Default severity:** `warning`

Unix permission modes are conventionally written in octal. A three-digit
decimal literal such as `644` passed as `os.FileMode` evaluates to a different
bit pattern than `0o644` and is usually a missing octal prefix.

## Bad

```go
os.WriteFile(path, data, 644)
```

## Good

```go
os.WriteFile(path, data, 0o644)
```

Source: https://strider.gempir.com/analyzers/decimal-file-mode/index.mdx
