utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandExists

func CommandExists(cmd string) bool

CommandExists checks if a command is available in PATH

func Contains

func Contains(slice []string, item string) bool

Contains checks if a string slice contains a specific item

func FormatFileSize

func FormatFileSize(size int64) string

FormatFileSize formats a file size in bytes to a human-readable string

func FormatFileSizeColored

func FormatFileSizeColored(size int64) string

FormatFileSizeColored returns a color-styled file size string based on size ranges

func GetFileIcon

func GetFileIcon(name string) string

GetFileIcon returns an emoji icon for a file based on its extension

func HighlightMatches

func HighlightMatches(text string, matches []int) string

HighlightMatches highlights matched characters in a string

func IsBinaryFile

func IsBinaryFile(path string) bool

IsBinaryFile returns true if the file is likely binary based on extension

func IsCodeFile

func IsCodeFile(name string) bool

IsCodeFile returns true if the file is a code file based on extension

func IsImageFile

func IsImageFile(name string) bool

IsImageFile returns true if the file is an image based on extension

func Min

func Min(a, b int) int

Min returns the minimum of two integers

func ShouldIgnore

func ShouldIgnore(name string) bool

ShouldIgnore returns true if a file/directory should be ignored

Types

This section is empty.

Jump to

Keyboard shortcuts

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