You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a reasonable request but is impractical to fix given the way the cover tool works. It works line-by-line, file-by-file. To solve it would require a much more global analysis of the program or be much more expensive. In your example it would either need to examine the rand package to see that Int63 can panic, or put a counter on every line, which could be too expensive in time and memory (and would require a major redesign).
go version go1.6.2 darwin/amd64
This is similar to #10185, but the issue still occurs if the panic happens inside of a function call.
A contrived example:
rand.go:
rand_test.go:
Coverage should be less than 100% because the
log.Println
inside of Rand is never called. But executing the tests with coverage shows:The issue is that the coverage blocks are not fine grained enough if a panic occurs in a function call.
The text was updated successfully, but these errors were encountered: