utils

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: MIT Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertError added in v1.0.4

func ConvertError(err error) error

ConvertError converts specific errors to the standard error type

func EscapeTitle added in v1.0.7

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 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