Documentation ¶
Index ¶
- func AnyError(errs ...error) error
- func Atoi(str string) int
- func Atoi64(str string) int64
- func ContainsInt(integers []int, v int) bool
- func ContainsString(str string, terms []string, caseSensitive bool) bool
- func FilterInt(integers []int, fn func(int) bool) (newIntegers []int)
- func LoadJSON(name string, v interface{}) (bool, error)
- func SaveJSON(name string, v interface{}) error
- func SplitAndTrimString(str, separator string) []string
- func Truncate(message string, maxLen int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyError ¶
AnyError checks each of the provided errors and returns the first one that is not nil. If all of them are nil, this function returns nil.
func ContainsInt ¶
ContainsInt determines whether the integer slice contains the specified integer.
func ContainsString ¶
ContainsString searches the provided string to see if it contains *any* of the provided search terms. The caseSensitive parameter is used to determine if the matches should be case sensitive.
func FilterInt ¶
FilterInt executes the provided function for each integer in the slice and only includes it in the slice returned if the function returns true.
func LoadJSON ¶
Load a JSON file from disk if it exists. The first value returned is true if the file existed and false if it did not (default values should be set).
func SplitAndTrimString ¶
SplitAndTrimString splits a string using the provided separator and then trims spaces from each of the strings.
Types ¶
This section is empty.