gocover

package module
v0.0.0-...-cc3a775 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

README

gocover

go cover profile CLI tool

Documentation

Overview

* @Date: 2021-01-18 17:42:17 * @LastEditors: aiden.deng (Zhenpeng Deng) * @LastEditTime: 2021-01-18 21:05:33

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileCoverage

type FileCoverage struct {
	Filename string
	Pkg      *Pkg
	Profile  *cover.Profile
	Covered  int
	Total    int
}

func (*FileCoverage) Percentage

func (f *FileCoverage) Percentage() float64

type FuncCoverage

type FuncCoverage struct {
	FuncName  string
	StartLine int
	Filename  string
	Pkg       *Pkg
	Profile   *cover.Profile
	Covered   int
	Total     int
}

func (*FuncCoverage) Percentage

func (f *FuncCoverage) Percentage() float64

type FuncExtent

type FuncExtent struct {
	// contains filtered or unexported fields
}

FuncExtent describes a function's extent in the source by file and position.

type FuncVisitor

type FuncVisitor struct {
	// contains filtered or unexported fields
}

FuncVisitor implements the visitor that builds the function position list for a file.

func (*FuncVisitor) Visit

func (v *FuncVisitor) Visit(node ast.Node) ast.Visitor

Visit implements the ast.Visitor interface.

type PackageCoverage

type PackageCoverage struct {
	PackageName string
	Pkg         *Pkg
	Profile     *cover.Profile
	Covered     int
	Total       int
}

func (*PackageCoverage) Percentage

func (p *PackageCoverage) Percentage() float64

type Pkg

type Pkg struct {
	ImportPath string
	Dir        string
	Error      *struct {
		Err string
	}
}

Pkg describes a single package, compatible with the JSON output from 'go list'; see 'go help list'.

type Profiles

type Profiles []*cover.Profile

func ParseProfiles

func ParseProfiles(fileName string) (Profiles, error)

func (*Profiles) Add

func (ps *Profiles) Add(p *cover.Profile)

func (*Profiles) FileLevelPercentageCovered

func (ps *Profiles) FileLevelPercentageCovered() ([]*FileCoverage, error)

func (*Profiles) FuncLevelPercentageCovered

func (ps *Profiles) FuncLevelPercentageCovered() ([]*FuncCoverage, error)

func (*Profiles) PackageLevelPercentageCovered

func (ps *Profiles) PackageLevelPercentageCovered() ([]*PackageCoverage, error)

func (*Profiles) Packages

func (ps *Profiles) Packages() ([]*Pkg, error)

Directories

Path Synopsis
cmd
pkg
browser
Package browser provides utilities for interacting with users' browsers.
Package browser provides utilities for interacting with users' browsers.

Jump to

Keyboard shortcuts

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