utils

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 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 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 RandomString

func RandomString(strlen int) string

RandomString returns random string

func RunCmd

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

RunCmd runs shell command and returns running error

func RunCmdOutput

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

RunCmdOutput runs shell command and returns it's output and 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

Types

This section is empty.

Jump to

Keyboard shortcuts

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