Documentation ¶
Index ¶
- func DoesFileExist(filename string) bool
- func DoesStringArrayContain(list []string, value string) bool
- func Ensure(condition bool, error string)
- func ExitWithErrorMessage(messages ...string)
- func FirstError(errorFuncs ...func() error) error
- func GetUserInput() string
- func Indent(message string, level int) string
- func Pluralize(count, word string) string
- func PrintError(messages ...string)
- func PrintLabelAndValue(label, value string)
- func RemoveStringFromSlice(list []string, value string) (result []string)
- func StringToBool(arg string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesFileExist ¶
DoesFileExist returns whether or not a file exists at the given path
func DoesStringArrayContain ¶
DoesStringArrayContain returns whether the given string slice contains the given string.
func Ensure ¶
Ensure asserts that the given condition is true. If not, it ends the application with the given error message.
func ExitWithErrorMessage ¶
func ExitWithErrorMessage(messages ...string)
ExitWithErrorMessage prints the given error message and terminates the application.
func GetUserInput ¶
func GetUserInput() string
GetUserInput reads input from the user and returns it.
func Indent ¶
Indent outputs the given string with the given level of indentation on each line. Each level of indentation is two spaces.
func Pluralize ¶
Pluralize outputs the count and the word. The word is made plural if the count isn't one
func PrintError ¶
func PrintError(messages ...string)
PrintError prints the given error message to the console.
func PrintLabelAndValue ¶
func PrintLabelAndValue(label, value string)
PrintLabelAndValue prints the label bolded and underlined the value indented on the next line followed by an empty line
func RemoveStringFromSlice ¶
RemoveStringFromSlice returns a new string slice which is the given string slice with the given string removed
func StringToBool ¶
StringToBool parses the given string into a bool
Types ¶
This section is empty.