cmd/cover: branching to a labeled for misses some coverage #28319
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
See below for a simple program that reports statements as uncovered when they are covered.
What version of Go are you using (
go version
)?go version go1.11 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Mac OS 10.13.6
What did you do?
Run "go test -cover" on the following code:
demo.go:
demo_test.go
What did you expect to see?
100% coverage
What did you see instead?
Running the html coverage tool shows the code "forloop: for i < y" as not covered. Changing the for to a switch does not change the result. However, changing the for to an if results in 100% coverage. The "goto" jumping over this code appears to be essential to the bug.
This issue may be the same as #27015.
The text was updated successfully, but these errors were encountered: