writer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package writer writes xml file based on the cobertura dtd: https://github.com/cobertura/cobertura/blob/master/cobertura/src/test/resources/dtds/coverage-04.dtd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteTextFMT

func WriteTextFMT(project *entity.Project, outPath string) error

func WriteXML

func WriteXML(path string, project *entity.Project, outPath string) error

Types

type Class

type Class struct {
	Methods *Methods `xml:"methods"`
	Lines   *Lines   `xml:"lines"`

	Name       string `xml:"name,attr"`
	Filename   string `xml:"filename,attr"`
	LineRate   string `xml:"line-rate,attr"`
	BranchRate string `xml:"branch-rate,attr"`
	Complexity string `xml:"complexity,attr"`
}

type Classes

type Classes struct {
	Classes []*Class `xml:"class"`
}

type Condition

type Condition struct {
	Number   string `xml:"number,attr"`
	Type     string `xml:"type,attr"`
	Coverage string `xml:"coverage,attr"`
}

type Conditions

type Conditions struct {
	Methods []*Condition `xml:"condition"`
}

type Coverage

type Coverage struct {
	XMLName xml.Name `xml:"coverage"`

	Sources  *Sources  `xml:"sources"`
	Packages *Packages `xml:"packages"`

	LineRate        string `xml:"line-rate,attr"`
	BranchRate      string `xml:"branch-rate,attr"`
	LinesCovered    string `xml:"lines-covered,attr"`
	LinesValid      string `xml:"lines-valid,attr"`
	BranchesCovered string `xml:"branches-covered,attr"`
	BranchesValid   string `xml:"branches-valid,attr"`
	Complexity      string `xml:"complexity,attr"`
	Version         string `xml:"version,attr"`
	Timestamp       string `xml:"timestamp,attr"`
}

func ConvertToCobertura

func ConvertToCobertura(path string, project *entity.Project) *Coverage

type Line

type Line struct {
	Conditions *Conditions `xml:"conditions"`

	Number            string `xml:"number,attr"`
	Hits              string `xml:"hits,attr"`
	Branch            string `xml:"branch,attr"`
	ConditionCoverage string `xml:"condition-coverage,attr"`
}

type Lines

type Lines struct {
	Lines []*Line `xml:"line"`
}

type Method

type Method struct {
	Lines *Lines `xml:"lines"`

	Name       string `xml:"name,attr"`
	Signature  string `xml:"signature,attr"`
	LineRate   string `xml:"line-rate,attr"`
	BranchRate string `xml:"branch-rate,attr"`
	Complexity string `xml:"complexity,attr"`
}

type Methods

type Methods struct {
	Methods []*Method `xml:"method"`
}

type Package

type Package struct {
	Classes *Classes `xml:"classes"`

	Name       string `xml:"name,attr"`
	LineRate   string `xml:"line-rate,attr"`
	BranchRate string `xml:"branch-rate,attr"`
	Complexity string `xml:"complexity,attr"`
}

type Packages

type Packages struct {
	Packages []*Package `xml:"package"`
}

type Source

type Source struct {
	Path string `xml:",chardata"`
}

type Sources

type Sources struct {
	Sources []*Source `xml:"source"`
}

Jump to

Keyboard shortcuts

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