Documentation ¶
Overview ¶
Package cover reports coverage on modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cover ¶
type Cover struct {
// contains filtered or unexported fields
}
Cover computes and reports on coverage.
func (*Cover) Config ¶ added in v0.21.0
func (c *Cover) Config() topdown.TraceConfig
Config returns the standard Tracer configuration for the Cover tracer
func (*Cover) TraceEvent ¶ added in v0.21.0
TraceEvent updates the coverage state.
type CoverageThresholdError ¶ added in v0.10.2
CoverageThresholdError represents an error raised when the global code coverage percenta is lower than the specified threshold.
func (*CoverageThresholdError) Error ¶ added in v0.10.2
func (e *CoverageThresholdError) Error() string
type FileReport ¶
type FileReport struct { Covered []Range `json:"covered,omitempty"` NotCovered []Range `json:"not_covered,omitempty"` Coverage float64 `json:"coverage,omitempty"` }
FileReport represents a coverage report for a single file.
func (*FileReport) IsCovered ¶
func (fr *FileReport) IsCovered(row int) bool
IsCovered returns true if the row is marked as covered in the report.
func (*FileReport) IsNotCovered ¶
func (fr *FileReport) IsNotCovered(row int) bool
IsNotCovered returns true if the row is marked as NOT covered in the report. This is not the same as simply not being reported. For example, certain statements like imports are not included in the report.
type PositionSlice ¶
type PositionSlice []Position
PositionSlice is a collection of position that can be sorted.
type Report ¶
type Report struct { Files map[string]*FileReport `json:"files"` Coverage float64 `json:"coverage"` }
Report represents a coverage report for a set of files.