aggregate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package aggregate turns per-file collector results into the single repository -> package -> file -> function tree the report and the treemap consume, computing every node's five coverage metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(in Input) *model.Report

Build assembles the report. It never returns nil: a scan that found no coverage still produces a well-formed document with a childless root.

Types

type Input

type Input struct {
	// Root is the absolute scan root, reported verbatim as the document's root.
	Root string
	// Projects are the collected results, in any order.
	Projects []ProjectFiles
	// Warnings are collector warnings, carried into the report.
	Warnings []string
	// Tool identifies the producing binary and version.
	Tool string
	// Now stamps the document; zero means time.Now().UTC().
	Now time.Time
}

Input is everything Build needs.

type ProjectFiles

type ProjectFiles struct {
	// Rel is the project directory relative to the scan root, slash-separated.
	Rel   string
	Files []model.FileCoverage
}

ProjectFiles is one detected project's collected files. Several projects may share a Rel (a directory holding both a go.mod and a package.json): they describe one repository and are merged.

Jump to

Keyboard shortcuts

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