coverage

package
v1.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(mode string, lines []*CovLine) string

the coverage format is defined at:

  https://github.com/golang/go/blob/master/src/cmd/cover/profile.go
>	First line is "mode: set|count|atomic".
>	Rest of file is in the format
>	  encoding/base64/base64.go:34.44,37.40 3 1
>	where the fields are: pkg/name.go:startLine.column,endLine.column numberOfStatements count

Types

type CovLine

type CovLine struct {
	Prefix string
	Count  int64
}

func Compact added in v1.0.32

func Compact(lines []*CovLine) []*CovLine

same file can have multiple lines of count see: https://go-review.googlesource.com/c/go/+/76875 go will append coverage profiles of multiple runnings

func Filter

func Filter(covs []*CovLine, check func(line *CovLine) bool) []*CovLine

func Merge

func Merge(covs ...[]*CovLine) []*CovLine

Merge profiles the result will be compacted

func Parse

func Parse(content string) (mode string, covLines []*CovLine)

func ParseCovLine

func ParseCovLine(line string) *CovLine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL