1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:04:44 -07:00
go/cmd/cover
Rob Pike f11381f265 go.tools/cmd/cover: don't assume code is gofmt'd
We want to make an if look like two blocks and have the coverage
report for the else block decorate the "else" keyword with the right
color. To do this, we adjust the apparent starting point of the else
block to include the "else".

The previous code assumed the way to do this was to move the
width of "else " backwards from the else block's opening brace, but
that assumes there is a space there. Instead, we now just start the
else block exactly at the end of the if block. Simpler, cleaner, and
fixes a bug.

Fixes golang/go#8557.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/127620043
2014-08-20 11:14:50 -07:00
..
testdata go.tools/cmd/cover: for range loops might contain function literals 2013-10-11 10:32:36 -07:00
cover_test.go go.tools/cmd/cover: fix build 2013-06-21 14:47:04 -07:00
cover.go go.tools/cmd/cover: don't assume code is gofmt'd 2014-08-20 11:14:50 -07:00
doc.go go.tools/cmd/cover: move docs to separate doc.go 2013-10-11 09:13:58 +09:00
func.go go.tools/cover: split parsing code out from cmd/cover 2013-12-03 20:55:21 -08:00
html.go cmd/cover: show file coverage in HTML drop down 2014-08-12 09:22:11 +10:00