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

cmd/cover: cannot dispose function parameters with inner function #47054

Closed
jnlunsb opened this issue Jul 5, 2021 · 3 comments
Closed

cmd/cover: cannot dispose function parameters with inner function #47054

jnlunsb opened this issue Jul 5, 2021 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@jnlunsb
Copy link

jnlunsb commented Jul 5, 2021

The Issue Example is shown as below
图片

red cicle means, go tool cover cannot acquire these uncvoered lines

It's go/cmd/go/cover.go bug

@smasher164 smasher164 changed the title Go Tool Cover cannot dispose function parameters with inner function cmd/cover: cannot dispose function parameters with inner function Jul 7, 2021
@mknyszek
Copy link
Contributor

mknyszek commented Jul 7, 2021

I'm having a hard time following what the problem is.

Could you provide an example of the code that produced the error as text, preferably as a Go playground link?

Also, since this appears to be related to the coverage tool, can you please provide the precise steps you took to reproduce your error?

And finally, please share the Go version you're using and the platform you're executing these commands on. Thanks.

@mknyszek mknyszek added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 7, 2021
@mknyszek mknyszek added this to the Backlog milestone Jul 7, 2021
@thanm
Copy link
Contributor

thanm commented Jul 8, 2021

I typed in your example code (or something approximating it) and did a coverage run on it. Attached
files.zip with the files I am using. When I run

go test -test.count=2 -coverprofile=cov.dat .
go tool cover -html=cov.dat

I get this output from the second step:

Screenshot from 2021-07-06 08-30-29

So, you are correct in that the coverage tool doesn't seem to be treating lines 13 and 14 as executable, but given that the reported coverage is 100%, why is this a problem?

@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Aug 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants