fsutils

package
v1.26.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RelativePathModeGoMod   = "gomod"
	RelativePathModeGitRoot = "gitroot"
	RelativePathModeCfg     = "cfg"
	RelativePathModeWd      = "wd"
)

Relative path modes.

View Source
const OutputPathModeAbsolute = "abs"

OutputPathModeAbsolute path mode used to show absolute paths in output reports (user-facing).

Variables

This section is empty.

Functions

func AllRelativePathModes added in v1.26.1

func AllRelativePathModes() []string
func EvalSymlinks(path string) (string, error)

func GetBasePath added in v1.26.1

func GetBasePath(ctx context.Context, mode, cfgDir string) (string, error)

func Getwd added in v1.9.3

func Getwd() (string, error)

func IsDir

func IsDir(filename string) bool

func NormalizePathInRegex added in v1.26.1

func NormalizePathInRegex(path string) string

NormalizePathInRegex it's a noop function on Unix.

func PrettifyBytesCount added in v1.26.1

func PrettifyBytesCount(n int64) string

func ShortestRelPath added in v1.7.1

func ShortestRelPath(path, wd string) (string, error)

func UseWdCache added in v1.9.3

func UseWdCache(use bool)

Types

type FileCache added in v1.26.1

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

func NewFileCache added in v1.26.1

func NewFileCache() *FileCache

func (*FileCache) GetFileBytes added in v1.26.1

func (fc *FileCache) GetFileBytes(filePath string) ([]byte, error)

func (*FileCache) PrintStats added in v1.26.1

func (fc *FileCache) PrintStats(log logutils.Log)

type LineCache added in v1.26.1

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

func NewLineCache added in v1.26.1

func NewLineCache(fc *FileCache) *LineCache

func (*LineCache) GetLine added in v1.26.1

func (lc *LineCache) GetLine(filePath string, index1 int) (string, error)

GetLine returns the index1-th (1-based index) line from the file on filePath

Jump to

Keyboard shortcuts

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