pathutil

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: 2 Imported by: 0

Documentation

Overview

Package pathutil holds the small path helpers shared by cover100's collectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RelTo

func RelTo(root, abs string) (string, bool)

RelTo returns abs expressed relative to root using forward slashes, which is the form every node id and report path uses.

ok is false when abs lies outside root: a coverage report may legitimately mention files the scan did not cover (a monorepo sibling, a linked package), and those must be dropped rather than reported under a "../" path.

Coverage tools report resolved paths, while the scan root is whatever the user typed, so the two can name the same directory through different symlink chains — on macOS `/tmp` is a symlink to `/private/tmp`, and a checkout can be reached through a linked workspace directory. When the literal comparison fails, both paths are resolved and compared again.

Types

This section is empty.

Jump to

Keyboard shortcuts

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