Standard library / testing

testing.CoverBlock

Historical coverage block metadata with one-based lines and byte columns. Use go tool cover for ordinary inspection. Expected stdout: '1 1\n'.

Formal Syntax & Structure

go syntaxgo
type CoverBlock struct {  Line0 uint32  Col0  uint16  Line1 uint32  Col1  uint16  Stmts uint16}

Working Example

Example Snippetgo
package main
import (  "fmt"  "testing")
func main() {  b := testing.CoverBlock{Line0: 1, Col0: 1, Line1: 2, Col1: 1, Stmts: 1}  fmt.Println(b.Line0, b.Stmts)}
Go Reference