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

go.tools/cmd/cover: Coverage reports 0% if there are no statements to cover #7968

Closed
gopherbot opened this issue May 11, 2014 · 4 comments
Closed
Milestone

Comments

@gopherbot
Copy link
Contributor

by ttencate:

What does 'go version' print?
go version go1.2.1 linux/386

What steps reproduce the problem?
1. Create foo.go and foo_test.go with contents only "package foo"
2. go test -cover foo

What happened?
ok      foo 0.003s  coverage: 0.0% of statements

What should have happened instead?
ok      foo 0.003s  coverage: 100.0% of statements

Both are technically correct. But 0.0% suggests there's room for improvement, whereas
100% indicates that we couldn't do any better.
@ianlancetaylor
Copy link
Member

Comment 1:

Labels changed: added repo-main, release-go1.4.

@ianlancetaylor
Copy link
Member

Comment 2:

Labels changed: added repo-tools, removed repo-main.

@robpike
Copy link
Contributor

robpike commented May 12, 2014

Comment 3:

0/0 is undefined.

@robpike
Copy link
Contributor

robpike commented May 12, 2014

Comment 4:

This isn't worth worrying about.

Status changed to WontFix.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants