You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
funcf() (errerror) {
// …err=g()
iferr!=nil {
// Don't wrap the error, because g provides all the necessary// context already.returnerr
}
returnnil
}
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.
The text was updated successfully, but these errors were encountered:
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:
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.The text was updated successfully, but these errors were encountered: