utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeFromString

func GetTimeFromString(input string) (time.Time, error)

GetTimeFromString transform a string to a duration

func GetToken

func GetToken() string

GetToken return a random token using md5 and the current time as a seed

func IsPathADir

func IsPathADir(path string) (bool, error)

IsPathADir returns a bool depending if a path is a dir and an error if the file do not exist

func IsPathAFile

func IsPathAFile(path string) (bool, error)

IsPathAFile returns a bool depending if a path is a file and an error if the file do not exist

func IsPathExist

func IsPathExist(path string) bool

IsFileExist returns a bool depending if a file exist or not

func IsSubstring added in v0.2.0

func IsSubstring(substring string, completeString string) (bool, error)

IsSubstring check if a string is a substring of another string

func PrintError

func PrintError(err error)

PrintError display the error message in the cli

func RemoveDetachedFlag

func RemoveDetachedFlag(args []string) []string

RemoveDetachedFlag returns a command without the detached flag

func RemoveDuplicate added in v0.2.0

func RemoveDuplicate(input []string) []string

RemoveDuplicate takes a slice of string as input and remove the duplicates

Types

This section is empty.

Jump to

Keyboard shortcuts

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