Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false positives for unnecessaryDefer. #926 #927

Merged
merged 1 commit into from May 18, 2020

Conversation

bombsimon
Copy link
Contributor

By keeping track of the block type we can differentiate between
functions and other blocks. This way we can enure that only blocks
ending with explicit return or end of functions yelds warnings.

By keeping track of the block type we can differentiate between
functions and other blocks. This way we can enure that only blocks
ending with explicit return or end of functions yelds warnings.
@quasilyte
Copy link
Member

Since it passes the tests and fixes the referenced issue, maybe we can merge it right away.

I can make a better review if I'll actually look at the entire checker code which I can't do right now. :)

Copy link
Member

@cristaloleg cristaloleg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm 🎉

@quasilyte quasilyte merged commit f4eb84b into go-critic:master May 18, 2020
@quasilyte
Copy link
Member

quasilyte commented May 18, 2020

If I'll have anything to add, there will be a follow-up.
@bombsimon feel free to submit more changes and/or tests. :)
Thank you for your contribution.

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.

None yet

3 participants