Skip to content

Go error rules#82

Open
GrosQuildu wants to merge 11 commits intomainfrom
go-error-rules
Open

Go error rules#82
GrosQuildu wants to merge 11 commits intomainfrom
go-error-rules

Conversation

@GrosQuildu
Copy link
Copy Markdown
Collaborator

@GrosQuildu GrosQuildu commented May 6, 2026

Adds three rules:

  • shadowed-err-checkif xErr := f(); err != nil declares one err-like var but checks a different one (typo / copy-paste).
  • pkg-errors-wrap-nil-errpkg/errors.Wrap / Wrapf / WithMessage / WithMessagef / WithStack called on a provably-nil err; these return nil for nil input, silently swallowing the failure path.
  • http-error-missing-returnhttp.Error(w, ...) not followed by return; handler keeps running after the error response.

I used regexes for error detection: typed metavariables don't seem to work for this type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant