Skip to content

Conversation

jhenstridge
Copy link
Contributor

If a function contains a nested function literal, we need to associate each return statement with the correct function. A naked return statement in the function literal may be okay if it has no named return
values.

To track state, we create a new visitor each time we enter a function or function literal.

Fixes #11

If a function contains a nested function literal, we need to associate
each return statement with the correct function.  A naked return
statement in the function literal may be okay if it has no named return
values.

To track state, we create a new visitor each time we enter a function or
function literal.
@alexkohler
Copy link
Owner

Thanks for the fix guys, lgtm. Probably worthwhile to get some CI/unit tests for nakedret so I'm not just manually smoke testing 😆

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.

nakedret reports false positives from nested functions
3 participants