Imports #
"bufio"
"errors"
"fmt"
"io"
"math"
"os"
"sort"
"strconv"
"strings"
"bufio"
"errors"
"fmt"
"io"
"math"
"os"
"sort"
"strconv"
"strings"
type blocksByStart []ProfileBlock
type boundariesByPos []Boundary
type byFileName []*Profile
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 tag and will be used to colorize the source
type Boundary struct {
Offset int
Start bool
Count int
Norm float64
Index int
}
Profile represents the profiling data for a specific file.
type Profile struct {
FileName string
Mode string
Blocks []ProfileBlock
}
ProfileBlock represents a single block of profiling data.
type ProfileBlock struct {
StartLine int
StartCol int
EndLine int
EndCol int
NumStmt int
Count int
}
Boundaries returns a Profile as a set of Boundary objects within the provided src.
func (p *Profile) Boundaries(src []byte) (boundaries []Boundary)
func (b blocksByStart) Len() int
func (p byFileName) Len() int
func (b boundariesByPos) Len() int
func (p byFileName) Less(i int, j int) bool
func (b boundariesByPos) Less(i int, j int) bool
func (b blocksByStart) Less(i int, j int) bool
ParseProfiles parses profile data in the specified file and returns a Profile for each source file described therein.
func ParseProfiles(fileName string) ([]*Profile, error)
ParseProfilesFromReader parses profile data from the Reader and returns a Profile for each source file described therein.
func ParseProfilesFromReader(rd io.Reader) ([]*Profile, error)
func (b blocksByStart) Swap(i int, j int)
func (b boundariesByPos) Swap(i int, j int)
func (p byFileName) Swap(i int, j int)
parseLine parses a line from a coverage file. It is equivalent to the regex ^(.+):([0-9]+)\.([0-9]+),([0-9]+)\.([0-9]+) ([0-9]+) ([0-9]+)$ However, it is much faster: https://golang.org/cl/179377
func parseLine(l string) (fileName string, block ProfileBlock, err error)
seekBack searches backwards from end to find sep in l, then returns the value between sep and end as an integer. If seekBack fails, the returned error will reference what.
func seekBack(l string, sep byte, end int, what string) (value int, nextSep int, err error)
Generated with Arrow