Documentation ¶
Index ¶
- Variables
- func AssertTestCase(t *testing.T, object interface{}, theCase TestCase)
- func AssertTestCases(t *testing.T, collection TestCollection)
- func CheckError(err error, message string)
- func DoesFileExist(name string) bool
- func Exit(rc int)
- func ExitWithErrorMessage(msg string)
- func FormatDuration(duration time.Duration) string
- func GetFilenameFromUrl(urlStr string) string
- func GetSudoPasswd() string
- func InterfaceSlice(slice interface{}) []interface{}
- func Load(path string, object interface{}) error
- func Md5OfFile(filepath string) string
- func MinMax(array []float64) (float64, float64, error)
- func RemoveOneValue(slice []float64, value float64) []float64
- func Save(path string, object interface{}) error
- func TrimToVisualLength(message string, length int) string
- func VerifyOrCreate(path string) error
- func VisualLength(str string) int
- type TestCase
- type TestCollection
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AssertTestCase ¶
func AssertTestCases ¶
func AssertTestCases(t *testing.T, collection TestCollection)
func CheckError ¶
CheckError will exit upon the presence of an error, showing a message upon error
func DoesFileExist ¶
DoesFileExist returns if the given file exists on disk
func ExitWithErrorMessage ¶
func ExitWithErrorMessage(msg string)
ExitWithErrorMessage will exit with return code 1 and output an error message
func FormatDuration ¶
FormatDuration outputs a given duration in HH:MM:SS
func GetFilenameFromUrl ¶
todo: return error and have caller handle GetFilenameFromUrl extracts the postfix filename from a given URL
func InterfaceSlice ¶
func InterfaceSlice(slice interface{}) []interface{}
func Md5OfFile ¶
todo: return error and have caller handle Md5OfFile returns the Md5 sum of a file given the path to the file
func RemoveOneValue ¶
RemoveOneValue removes the first matching value from the given array of float64 values
func TrimToVisualLength ¶
TrimToVisualLength truncates the given message to the given length (taking into account ansi escape sequences)
func VerifyOrCreate ¶
Checks if specified directory exists and, if it doesn't, create it
func VisualLength ¶
VisualLength determines the length of a string (taking into account ansi control sequences)
Types ¶
type TestCollection ¶
type TestCollection struct { Collection []interface{} Cases []TestCase }