Documentation ¶
Overview ¶
Package utils contains helper functions used across the project
Index ¶
- func GetFloat64(dict map[string]string, key string, warnings *[]string) float64
- func GetString(dict map[string]string, key string) string
- func GetStringInterface(dict map[string]interface{}, key string) string
- func GetUint64(dict map[string]string, key string, warnings *[]string) uint64
- func ParseFakeExecCmdArgs() (string, []string)
- type ExecCmdFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFloat64 ¶
GetFloat64 returns the dict[key] or an empty uint64 if the entry doesn't exists
func GetStringInterface ¶
GetStringInterface returns the dict[key] or an empty string if the entry doesn't exists or the value is not a string
func ParseFakeExecCmdArgs ¶
ParseFakeExecCmdArgs parses the CLI's os.Args as passed by fakeExecCmd and returns the testRunName, and cmdList. Meant to be used from test functions that are called by a fakeExecCmd built with BuildFakeExecCmd.
Types ¶
type ExecCmdFunc ¶
ExecCmdFunc is a function type that matches exec.Command's signature
func BuildFakeExecCmd ¶
func BuildFakeExecCmd(testName string, testRunName string) ExecCmdFunc
BuildFakeExecCmd returns a fakeExecCmd for the testName and testRunName. See platform/platform_common_test.go for an example of how to use it to mock exec.Cmd in tests.