helpers

package
v0.0.0-...-aff28e3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cond

func Cond[T any](condition bool, primary, fallback T) T

func ConfigDir

func ConfigDir(file string) string

Defaults to ~/.config/file

func CopyFile

func CopyFile(source string, destinations ...string) error

func CreateParentDirs

func CreateParentDirs(dest string) error

func DataDir

func DataDir(file string) string

Defaults to ~/.local/share/file

func FileExists

func FileExists(file string) bool

func MergeToFile

func MergeToFile(lines []string, file string, sortFunc func(s1, s2 string) bool) error

func NewTmpCachePath

func NewTmpCachePath() string

func ReadFileToLines

func ReadFileToLines(file string) ([]string, error)

func RemoveDuplicates

func RemoveDuplicates[T comparable](slice []T) []T

func WriteFile

func WriteFile(content string, destinations ...string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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