Exported I/O function with no context.Context parameter
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.
What it detects
An exported function calls something that performs network, disk, or database I/O but does not take a context.Context as its first parameter, so callers have no way to cancel it or apply a deadline. Heuristic based on a single-line function signature; only catches functions with their whole signature on one line.
Why it matters
A context.Context is how Go code propagates cancellation and deadlines through a call chain: when a caller times out or gives up, everything downstream that is watching ctx.Done() can stop promptly instead of continuing to run I/O that nobody is waiting for anymore. An exported function that does network, disk, or database I/O but does not accept a context leaves every caller unable to bound how long it might run or cancel it early, which becomes a real problem the first time one of those calls hangs.
How to fix it
Add ctx context.Context as the first parameter, thread it through to whichever I/O call this function makes (the *Context variant: QueryContext, http.NewRequestWithContext, and so on), and update this function's callers to pass a context they already have, or context.Background() at the outermost caller if none exists yet.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo