diff options
| author | Agniva De Sarker <agnivade@yahoo.co.in> | 2018-12-23 15:01:11 +0530 |
|---|---|---|
| committer | Agniva De Sarker <agniva.quicksilver@gmail.com> | 2019-03-13 04:11:58 +0000 |
| commit | b6544a2a87b17f552c3ab4f7f0f082e48b56d5fa (patch) | |
| tree | 806a0ecfdd52e6db5cad2d3c6ea273686c114dda /src/testing | |
| parent | 0ff9df6b53076a9402f691b07707f7d88d352722 (diff) | |
| download | go-b6544a2a87b17f552c3ab4f7f0f082e48b56d5fa.tar.xz | |
testing/cover: improve message when a package has no statements
Fixes #25492
Change-Id: Ic1496857524dad0c0a77f3bb80fa084c9bf00aa9
Reviewed-on: https://go-review.googlesource.com/c/go/+/155777
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/cover.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/testing/cover.go b/src/testing/cover.go index 17c03f5e5e..62ee5ac9c0 100644 --- a/src/testing/cover.go +++ b/src/testing/cover.go @@ -109,7 +109,8 @@ func coverReport() { } } if total == 0 { - total = 1 + fmt.Println("coverage: [no statements]") + return } fmt.Printf("coverage: %.1f%% of statements%s\n", 100*float64(active)/float64(total), cover.CoveredPackages) } |
