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 ./... handling #4

Open
mcandre opened this issue Mar 31, 2018 · 5 comments
Open

Fix ./... handling #4

mcandre opened this issue Mar 31, 2018 · 5 comments

Comments

@mcandre
Copy link

mcandre commented Mar 31, 2018

nakedret complains warning: "./..." matched no packages when there are multiple top-level *.go source files to lint. Please correct nakedret's parsing of ./... and .\... so that it includes top-level files, not just subdirectory paths.

@alexkohler
Copy link
Owner

I'm not able to reproduce this behavior - could you give an example?

@alexkohler
Copy link
Owner

@mcandre Closing this for now, feel free to reopen if you're still running into this issue.

@mcandre
Copy link
Author

mcandre commented May 21, 2024

Most Go tools support the standard syntax ./... to instruct the tool to automatically recurse over all directories and *.go files. For example, go install ./... compiles and installs all Go applications in the current project.

However, nakedret fails to support this.

As a workaround, the user has to implement the recursion manually. Most Go users are not equipped to perform this reliably, and often end up breaking the portability of their build system.

@alexkohler
Copy link
Owner

Hey there, thanks for the follow-up here! I unfortunately won't have bandwidth to address this in the immediate future, but I'm definitely open to PRs for supporting this 👍

@mcandre
Copy link
Author

mcandre commented Aug 27, 2024

Manually wrapping nakedret in Go code to recurse over project files. Here's an example:

https://github.com/mcandre/mage-extras/blob/master/nakedret.go

This code could be promoted into the nakedret tool itself in order to process the standard Go language ellipsis syntax faithfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants