fileops

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red    string = "\x1b[31;1m"
	Green  string = "\x1b[32;1m"
	Yellow string = "\x1b[33;1m"
	Blue   string = "\x1b[34;1m"
	Purple string = "\x1b[35;1m"
	Cyan   string = "\x1b[36;1m"
	White  string = "\x1b[37;1m"

	WeirdColor string = "\x1b[38;2;255;102;153m"

	Reset string = "\x1b[0m"
)

Variables

This section is empty.

Functions

func CheckIfError

func CheckIfError(err error)

func CheckIfErrorWithMessage

func CheckIfErrorWithMessage(err error, message string)

func ColorPrint

func ColorPrint(message string, color string)

func ColorPrintf

func ColorPrintf(color string, format string, a ...any)

func ColorPrintfn

func ColorPrintfn(color string, format string, a ...any)

func ColorPrintln

func ColorPrintln(message string, color string)

func CopyFile

func CopyFile(src, dst string) error

func CopyFileToDir

func CopyFileToDir(src, dst string) error

func EnsureDir

func EnsureDir(dirName string) error

EnsureDir creates a directory if it does not exist. The dirName parameter should only contain the directory path and should not include the filename.

func ExpandPath

func ExpandPath(path string) (string, error)

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(file string) bool

func IsFileErr

func IsFileErr(file string) (bool, error)

func NormalizeLineEndings added in v0.0.47

func NormalizeLineEndings(content string) string

NormalizeLineEndings converts CRLF and bare CR line endings to LF.

func PathExists

func PathExists(path string) bool

func SColor

func SColor(message string) string

func SColorPrint

func SColorPrint(message string, color string) string

func SColorPrintf

func SColorPrintf(format string, a ...any) string

func SColorPrintln

func SColorPrintln(message string, color string) string

func WriteTextFileLF added in v0.0.47

func WriteTextFileLF(path, content string, perm os.FileMode) error

WriteTextFileLF writes a text file with LF line endings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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