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
Expected behavior
No spancheck lint on the ended span, since it's always ended.
Additional context
This is a somewhat common pattern that I've seen used to always capture the error from any returned error in a function, that seems to trip up spancheck - it should be able to tell that span.End() is unconditionally ended, despite not being the first statement in the defer?
The text was updated successfully, but these errors were encountered:
I feared the day this bug report would arrive... I've hit this myself, honestly, and also like that approach of using named errors to set the status and error on the span. I gave a fix 30m a bit ago, but haven't properly fixed it. I have a long flight coming up that might be an ideal time...
It'll take a bit before it's merged and released in golangci-lint (assuming that's how you're using the linter). Please report here and re-open this issue if it persists after picking up this latest version tho, v0.6.4
Describe the bug
False positive with defer including check for named error return.
To Reproduce
Expected behavior
No spancheck lint on the ended span, since it's always ended.
Additional context
This is a somewhat common pattern that I've seen used to always capture the error from any returned error in a function, that seems to trip up spancheck - it should be able to tell that
span.End()
is unconditionally ended, despite not being the first statement in the defer?The text was updated successfully, but these errors were encountered: