From: Rob Pike Date: Sat, 30 Jun 2018 22:03:36 +0000 (+1000) Subject: testing/cover: improve comments on CoverBlock X-Git-Tag: go1.11beta2~239 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6780042f0a30569abcc3c5e9e0376761ac928ef5;p=gostls13.git testing/cover: improve comments on CoverBlock 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 --- diff --git a/src/testing/cover.go b/src/testing/cover.go index be7d9e2cc3..17c03f5e5e 100644 --- a/src/testing/cover.go +++ b/src/testing/cover.go @@ -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