utils

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm added in v0.1.7

func Confirm(msg string) bool

func CreateDirectory

func CreateDirectory() (dirPath string, err error)

func DiscardLastCharacter added in v0.1.5

func DiscardLastCharacter(s string) string

Discards the last character of a string

func ExpandHashtag added in v0.1.5

func ExpandHashtag(pathWithHashtag string) ([]string, error)

Function to expand the delimiter '#' to every file under that directory

Example "~/Pictures/#" -->["Pictures/img1.png","~/Pictures/img2.png","~/Pictures/img3.png"]

func ExpandHomeDirectory

func ExpandHomeDirectory(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 IsKittyTerminalRunning added in v0.1.6

func IsKittyTerminalRunning() bool

Checks if the terminal using gowall is the kitty terminal emulator

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