internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package internal contains miscellaneous functions and objects useful within Scalibr

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTransitiveMaps

func BuildTransitiveMaps(m map[string]int) map[string]int

BuildTransitiveMaps fills the transitive map with aggregated numbers from subdirs.

func MatchNamedCaptureGroups

func MatchNamedCaptureGroups(regEx *regexp.Regexp, content string) map[string]string

MatchNamedCaptureGroups takes a regular expression and string and returns all of the named capture group results in a map. This is only for the first match in the regex. Callers shouldn't be providing regexes with multiple capture groups with the same name.

func ParentDir

func ParentDir(path string, n int) string

ParentDir returns the parent dir up to n dirs deep. If the path is below n dirs, the function returns path. This function assumes no leading `/` or drive letter.

func WalkDirUnsorted

func WalkDirUnsorted(fsys fs.FS, root string, fn fs.WalkDirFunc) error

WalkDirUnsorted walks the file tree rooted at root, calling fn for each file or directory in the tree, including root.

All errors that arise visiting files and directories are filtered by fn: see the fs.WalkDirFunc documentation for details.

WalkDirUnsorted does not follow symbolic links found in directories, but if root itself is a symbolic link, its target will be walked.

Types

This section is empty.

Directories

Path Synopsis
Package units provides constants for common units.
Package units provides constants for common units.

Jump to

Keyboard shortcuts

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