1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:14:47 -07:00
go/cmd/cover
Rob Pike 0c09ff325a cmd/cover: preserve //go: comments
Cover deleted all comments because they can break the simple way that
counters are injected into the rewritten source. But //go: comments have
semantic value, and for instance go test -cover runtime fails during
compilation because of their absence from the annotated source.

We can keep the //go: comments because they are at the beginning of
the line and are not affected by our counter injection.

Fixes #10270.

After this CL, go test -cover runtime works.
A testing strategy that does not involve a golden file would be welcome
but I can't think of one.

Change-Id: I73f7b7a36383a8efed8e33fa2414cd0eac7d015a
Reviewed-on: https://go-review.googlesource.com/8173
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-27 21:01:39 +00:00
..
testdata cmd/cover: do not cover statements after panic 2015-03-27 17:59:54 +00:00
cover_test.go go.tools/cmd/cover: fix build 2013-06-21 14:47:04 -07:00
cover.go cmd/cover: preserve //go: comments 2015-03-27 21:01:39 +00:00
doc.go tools: add import comments. 2014-12-09 22:42:16 +00:00
func.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
html.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00