Skip to content

nil-context

Detect nil context.Context arguments.

Updated View as Markdown

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

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

Good

load(context.TODO())
Navigation

Type to search…

↑↓ navigate↵ selectEsc close