utilities

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, i string) []string

func Check

func Check(err error, message string) bool

func CheckIfInstalled

func CheckIfInstalled(binary string) bool

CheckIfInstalled usees command -v to check if a binary is current in the path. Returns true if it is installed

func DownloadToFile

func DownloadToFile(uri string, dst string) error

func ErrorCheck

func ErrorCheck(err error, message string)

func ErrorWithHelp

func ErrorWithHelp(cmd *cobra.Command, message string)

ErrorWithHelp Show show error message, help menu and exit

func HTTPDownload

func HTTPDownload(uri string) ([]byte, error)

func HandleError

func HandleError(err error, args ...string) bool

HandleError prints error with fail printer if it exists

func Keys

func Keys(arr map[string]string) []string

Keys returns the keys of a map

func LineWith

func LineWith(lines string, text string) string

func LocationHash

func LocationHash() string

func RandStringBytesRmndr

func RandStringBytesRmndr(n int) string

func RemoveFromPath

func RemoveFromPath(s string) string

func StringInSlice

func StringInSlice(a string, list []string) bool

func UniqueStringMerge

func UniqueStringMerge(aString string, bString string) string

func WriteFile

func WriteFile(dst string, d []byte) error

Types

type RunCommand

type RunCommand struct {
	Desc    string
	Command string
}

Jump to

Keyboard shortcuts

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