-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
I generally like the check, as it shows a lot of places where errors aren't enriched with context, but in some of the projects I'm working on we have a rule: whenever you return an error, you must either add context to it or write a comment on why you didn't do it. For example:
func f() (err error) {
// …
err = g()
if err != nil {
// Don't wrap the error, because g provides all the necessary
// context already.
return err
}
return nil
}I was wondering if branches with comments could be excluded from the check? Just writing return g() may be a bit too unnoticeable, I think.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels