---
title: "nil-context"
description: "Detect nil context.Context arguments."
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.

# nil-context

**Default severity:** `error`

A context must not be nil. Use `context.TODO()` when the appropriate parent is
not known or `context.Background()` for an explicit root.

## Bad

```go
load(nil) // reported when the first parameter is context.Context
```

## Good

```go
load(context.TODO())
```

Source: https://strider.gempir.com/analyzers/nil-context/index.mdx
