utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedColor   = "\033[31m"
	BlueColor  = "\033[34m"
	ResetColor = "\033[0m"
)

ANSI escape codes for color

Variables

This section is empty.

Functions

func Confirm added in v0.1.7

func Confirm(msg string) bool

func DownloadUrl added in v0.2.0

func DownloadUrl(url, dest string) error

downloads a file from a url and places it in a specified destination

func ExpandTilde added in v0.2.1

func ExpandTilde(paths []string) []string

Function to expand the tilde (~) to the full home directory path @Example ~/Pictures/flowers.png --> /home/username/Pictures/flowers.png

func FormatErrors added in v0.1.6

func FormatErrors(errs []error) string

Formats a slice of errors to a single error, each seperated by a new line

func GetFileExtensionFromURL added in v0.1.7

func GetFileExtensionFromURL(rawurl string) (string, error)

func HandleError added in v0.1.6

func HandleError(err error, msg ...string)

Prints the error in red and exits

func OpenURL added in v0.1.7

func OpenURL(url string) error

opens a URL in your default browser of your operating system

Types

This section is empty.

Jump to

Keyboard shortcuts

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