Documentation ¶
Overview ¶
Package util provides misc utility functions.
Index ¶
- func AbbrPath(name string) string
- func CalcSizeCount(src ...string) (int64, int)
- func ExpandPath(name string) string
- func FormatSize(n int64) string
- func Quote(s string) string
- func RemoveExt(name string) string
- func SearchCommands() (map[string]bool, error)
- func ShortenPath(path string, width int) string
- func SplitWithSep(s, sep string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcSizeCount ¶
CalcSizeCount calculates files total size and count, excluding themself of directories and links.
func ExpandPath ¶
ExpandPath expands path beginning of ~ to the home directory. Not use for file operations because unexpected behavior when exist a file beginning of ~
func Quote ¶
Quote encloses string double quotes and escapes by backslash if this string contains double quotes.
func SearchCommands ¶
SearchCommands returns map with key is command name in $PATH.
func ShortenPath ¶
ShortenPath returns a shorten path to be shorter than width.
func SplitWithSep ¶
SplitWithSep splits string with separator.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.