BETA Shoulder is in beta — Findings may sometimes be wrong. Your feedback shapes what we fix next. Share feedback
Rules / Go

Unchecked Error Return Values

Description

Error return value ignored using blank identifier (_).

How to fix

Check all error return values and handle appropriately.

```go
data, err := ioutil.ReadFile(path)
if err != nil {
    return fmt.Errorf("failed to read file: %w", err)
}
```

Learn more: https://shoulder.dev/learn/go/cwe-252/unchecked-errors

Applies to

Languages

Scan for this issue

Detect with Shoulder CLI
npx @shoulderdev/cli trust --rule=go-unchecked-errors .

Related rules