Documentation ¶
Index ¶
- func ExecCmd(command string, args []string, o io.Writer, e io.Writer) ([]byte, []byte, error)
- func GetMapKeys(m interface{}) ([]interface{}, error)
- func GetMapSortedKeys(m interface{}, reverse bool) interface{}
- func IsElementInArray(elem interface{}, array []interface{}, fn CompareFunc) bool
- func StripAnsi(str string) string
- type CompareFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCmd ¶
ExecCmd executes command shell. It redirects output and errors to standard and then stores in a bytes. It returns command's stdout and stderr in bytes and error of command execution
func GetMapKeys ¶
func GetMapKeys(m interface{}) ([]interface{}, error)
GetMapKeys returns a slice of keys.
func GetMapSortedKeys ¶
func GetMapSortedKeys(m interface{}, reverse bool) interface{}
GetMapSortedKeys returns a sorted slice contaning keys of map as interface{}// and need to be casted in the format as you want
This function supports the following type of key: string, int If the given parameter is not a map, it will return nil
func IsElementInArray ¶
func IsElementInArray(elem interface{}, array []interface{}, fn CompareFunc) bool
Check if an element is in an array of elements of the same type func IsElementInArray(elem interface{}, array []interface{}, fn CompareFunc) bool {
Types ¶
type CompareFunc ¶
type CompareFunc func(elem1 interface{}, elem2 interface{}) bool
type void* interface{}
Click to show internal directories.
Click to hide internal directories.