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

proposal: cmd/cover: report untested nil values entry-points #17272

Closed
henvic opened this issue Sep 28, 2016 · 1 comment
Closed

proposal: cmd/cover: report untested nil values entry-points #17272

henvic opened this issue Sep 28, 2016 · 1 comment

Comments

@henvic
Copy link
Contributor

@henvic henvic commented Sep 28, 2016

Given that null references cause so much unexpected trouble, what about reporting untested entry points that could cause nil point panics on the code coverage report?

This could be limited to public functions and show as a small flag on the HTML reports.

Example:

...
var projects, err = repo.GetProjects() [nil]
...

where [nil] would actually be a report flag saying this code wasn't covered with a nil return for this value.

Reference: Null References: The Billion Dollar Mistake

@quentinmit quentinmit modified the milestone: Proposal Oct 4, 2016
@adg
Copy link
Contributor

@adg adg commented Oct 31, 2016

This is not the purpose of the test coverage tool. If you want to build a tool that does this and use the coverage UI, the code is there for the taking.

@adg adg closed this Oct 31, 2016
@golang golang locked and limited conversation to collaborators Oct 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.