utils

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertError

func ConvertError(err error) error

ConvertError converts specific errors to the standard error type

func EscapeTitle

func EscapeTitle(title string) string

EscapeTitle makes title usable for tmux session name

func Fatal

func Fatal(i ...interface{})

Fatal prints error and exits if errir

func FatalOnErr

func FatalOnErr(err error)

FatalOnErr prints error and exits if errir is not nil

func FprintRpad added in v2.3.0

func FprintRpad(w io.Writer, str string, l int)

func Max

func Max(a, b int) int

Max finds max integer

func RunCmd

func RunCmd(cmd string, args ...string) error

RunCmd runs shell command and returns running error

func ScanLines

func ScanLines(r io.Reader, callback func([]byte) bool) error

ScanLines reads line by line from reader. Doesn't throw "token too long" error like bufio.Scanner

func SplitAndTrim

func SplitAndTrim(str string) (res []string)

SplitAndTrim splits string, trims every entry and removes blank entries

func StringsContain

func StringsContain(strs []string, str string) bool

StringsContain returns true if provided string slice contains provided string

func WildcardMatch

func WildcardMatch(pattern, str string) bool

WildcardMatch returns true if provided string matches provided wildcard

Types

This section is empty.

Jump to

Keyboard shortcuts

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