---
title: "deprecated-api-usage"
description: "Detect uses of deprecated packages and APIs."
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.

# deprecated-api-usage

**Default severity:** `warning`

Go documentation can mark packages, functions, methods, fields, variables,
constants, and types with a `Deprecated:` paragraph. This check reads those
markers from loaded dependencies and reports resolved uses from other
packages, including deprecated struct fields.

Standard-library deprecations are reported only when the module targets the
running Go language version or newer, avoiding recommendations based on API
documentation newer than an older module's target.

## Bad

```go
value, err := ioutil.ReadAll(reader)
```

## Good

```go
value, err := io.ReadAll(reader)
```

Source: https://strider.gempir.com/analyzers/deprecated-api-usage/index.mdx
