Will It Vibe logoWill It Vibe?
GO-007Medium severity-8 points

Error return discarded with the blank identifier

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.

What it detects

A well-known error-returning standard-library call has its error return assigned to _ instead of checked, so a failure (a missing file, bad JSON, an unreachable host) passes silently and the caller proceeds as if it had succeeded.

Why it matters

Assigning a well-known error-returning call's error to _ throws away the only indication that the call failed. os.Open, json.Unmarshal, strconv.Atoi, and similar calls fail routinely in production for reasons that have nothing to do with a bug in this code (a missing file, malformed input, a network blip), and silently ignoring that means the program continues with a zero-value result as if the call had succeeded, which tends to surface later as a confusing downstream failure instead of a clear one at the source.

How to fix it

Capture the error and handle it: return it to the caller, log it with enough context to debug, or take an explicit fallback action. If you have genuinely reasoned through why this specific call cannot fail in this context, keep the underscore but say so in a comment so the next reader does not have to re-derive that reasoning.

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

Related Code Quality & Syntax checks