]> Cypherpunks repositories - gostls13.git/commitdiff
testing/cover: improve comments on CoverBlock
authorRob Pike <r@golang.org>
Sat, 30 Jun 2018 22:03:36 +0000 (08:03 +1000)
committerRob Pike <r@golang.org>
Sun, 1 Jul 2018 08:07:47 +0000 (08:07 +0000)
The previous CL (https://go-review.googlesource.com/c/go/+/96756)
added comments that didn't really say much, but there is something
so say: what the units are and that they are indexed starting at 1.

Add a more helpful comment on the type, and also follow proper
style by using initial capitals and a period.

Change-Id: Id19cd5f392faf7c7bac034073f276cc770589075
Reviewed-on: https://go-review.googlesource.com/121875
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/testing/cover.go

index be7d9e2cc3d4f6c9110068fb126245eedd57d62f..17c03f5e5ef69fac5202c0306270e958e23be6ef 100644 (file)
@@ -13,14 +13,17 @@ import (
 )
 
 // CoverBlock records the coverage data for a single basic block.
+// The fields are 1-indexed, as in an editor: The opening line of
+// the file is number 1, for example. Columns are measured
+// in bytes.
 // NOTE: This struct is internal to the testing infrastructure and may change.
 // It is not covered (yet) by the Go 1 compatibility guidelines.
 type CoverBlock struct {
-       Line0 uint32 // line number for block start
-       Col0  uint16 // column number for block start
-       Line1 uint32 // line number for block end
-       Col1  uint16 // column number for block end
-       Stmts uint16 // number of statements included in this block
+       Line0 uint32 // Line number for block start.
+       Col0  uint16 // Column number for block start.
+       Line1 uint32 // Line number for block end.
+       Col1  uint16 // Column number for block end.
+       Stmts uint16 // Number of statements included in this block.
 }
 
 var cover Cover