package cover
import "golang.org/x/tools/cover"
Package cover provides support for parsing coverage profiles generated by "go test -coverprofile=cover.out".
Index ¶
- type Boundary
- type Profile
- func ParseProfiles(fileName string) ([]*Profile, error)
- func ParseProfilesFromReader(rd io.Reader) ([]*Profile, error)
- func (p *Profile) Boundaries(src []byte) (boundaries []Boundary)
- type ProfileBlock
Types ¶
type Boundary ¶
type Boundary struct { Offset int // Location as a byte offset in the source file. Start bool // Is this the start of a block? Count int // Event count from the cover profile. Norm float64 // Count normalized to [0..1]. Index int // Order in input file. }
Boundary represents the position in a source file of the beginning or end of a block as reported by the coverage profile. In HTML mode, it will correspond to the opening or closing of a <span> tag and will be used to colorize the source
type Profile ¶
type Profile struct { FileName string Mode string Blocks []ProfileBlock }
Profile represents the profiling data for a specific file.
func ParseProfiles ¶
ParseProfiles parses profile data in the specified file and returns a Profile for each source file described therein.
func ParseProfilesFromReader ¶
ParseProfilesFromReader parses profile data from the Reader and returns a Profile for each source file described therein.
func (*Profile) Boundaries ¶
Boundaries returns a Profile as a set of Boundary objects within the provided src.
type ProfileBlock ¶
ProfileBlock represents a single block of profiling data.
Source Files ¶
profile.go
- Version
- v0.30.0 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 5 hours ago –
Tools for package owners.