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
x/tools/cmd/vet: warn about unused non-exported functions #4827
Labels
Milestone
Comments
This has probably been mentioned elsewhere, but I'll include a link here for future reference. Rémy has implemented some dead code detection at: https://github.com/remyoudompheng/go-misc/blob/master/deadcode/deadcode.go |
rsc
changed the title
cmd/vet: warn about unused non-exported functions
x/tools/cmd/vet: warn about unused non-exported functions
Apr 14, 2015
Do we need this? If so, I could work on it in 1.9. Let me know. |
IMHO, probably ok as an optional vet check, but as gri mentioned, it will
give false positive on debug functions, so we can't make it part of the
default checks.
Also note the check has to take test files and excluded files (via build
tags) into consideration too. Such a test would be nice, but I think it's
too complicated to get 100% right.
|
I think it's probably too hard to get the false positives rate low enough in the real world. It might work as a lint check, which can be looser. Closing. |
I think that might be too much even for lint, but if anyone does want this check, |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: