Documentation ¶
Index ¶
- func Contains(input []interface{}, value interface{}) (bool, error)
- func CopyFile(dst, src string, perm os.FileMode) error
- func ExecCommand(name string, args ...string) error
- func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
- func IsDirEmpty(dir string) (bool, error)
- func MoveDir(srcDir, dstDir string) error
- func RemoveDuplicateElement(addrs []string) []string
- func SliceTrimSpace(input []string) []string
- func StringInSlice(input []string, str string) bool
- func StringSliceEqual(s1, s2 []string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCommand ¶
ExecCommand is a wrapper of exec Command
func IfThenElse ¶
func IfThenElse(condition bool, a interface{}, b interface{}) interface{}
IfThenElse evaluates a condition, if true returns the first parameter, Otherwise the second.
func IsDirEmpty ¶
IsDirEmpty is to check if a directory is empty
func RemoveDuplicateElement ¶
RemoveDuplicateElement delete duplicate item from slice
func SliceTrimSpace ¶
SliceTrimSpace delete empty item, like " ", "\t", "\n" from slice
func StringInSlice ¶
StringInSlice checks if a string in the slice.
func StringSliceEqual ¶
StringSliceEqual compare two string slice, ignore the order. we also should consider if there has duplicate items in slice.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.