# Functions
AnySliceToTypedSlice determines whether input is []any and if so converts to an array of the underlying type.
AppendSliceUnique appends elements from slice2 to slice1, omitting duplicates.
Clean removes non-printing characters from the string.
CloneStringMap :: clone a string map - return a copy of the map.
No description provided by the author
No description provided by the author
DereferencePointer checks if val is a pointer, and if so, dereferences it.
EscapePropertyName replaces any '.' characters in the property name with propertyPathDotEscape.
ExecuteMethod use reflection to invoke method.
FileHash streams a file into a MD5 hasher and returns the resultant MD5 hash as a HEX encoded string.
FileMD5Hash streams a file into a MD5 hasher and returns the resultant MD5 hash bytes This DOES NOT read the whole file into memory.
FilterMap builds a map based on `src`, but using only keys specified in `keys`.
No description provided by the author
GetCallingFunction :: return the calling function level is how far up the call stack to go.
GetFieldValueFromInterface uses reflection to return the value of the given property path.
GetFunctionName :: return the name of the given function.
GetMD5Hash returns the MD5 hash of the given string.
GetNestedFieldValueFromInterface uses reflection to return the value of the given nested property path.
InstantiateType returns a interface representing the zero value for the specified type.
TODO: add support for multi-dimensional arrays
like - arr[1][2] arr[1][2][3] and so on.
IsNil uses reflection to determine whether the given value is nil this is needed as a simple 'val == nil' check does not work for an interface https://mangatmodi.medium.com/go-check-nil-interface-the-right-way-d142776edef1.
IsZero uses reflection to determine whether the given value is the zero value of it's type.
LimitPrintableRunes limits the string to the given number of runes.
LintName modifies the given name to make common intialialisms upper case.
MergeMaps merges 'new' onto 'old'.
MergeStringMaps :: merge 2 string maps, returning a new map.
PadRight returns a new string of a specified length in which the end of the current string is padded with spaces or with a specified Unicode character.
PrintableLength returns the number of printable runes in a string (after stripping ansi codes).
RemoveFromStringSlice removes the given string from the string slice.
Resize resizes the string with the given length.
SliceToLookup converts a slice into a lookup.
SortedMapKeys returnes the sorted keys of the map `m`.
SplitByRune uses the CSV decoder to parse out the tokens - even if they are quoted and/or escaped.
SplitByWhitespace splits by the ' ' rune.
StringFnvHash returns a FNV1 hash of the given string.
StringSliceContains returns whether the string slice contains the given string.
StringSliceDiff returns values which only exists in the fist string slice.
StringSliceDistinct returns a slice with the unique elements the input string slice.
No description provided by the author
StringSliceHasDuplicates returns whether a string slice has duplicate elements.
StructToMap uses reflection to convert a struct to a map.
Tabify adds the provided tab string to beginning of each line of string.
TabifyStringSlice adds the provided tab string to beginning of each line of string.
ToError formats the supplied value as an error (or just returns it if already an error).
ToTypedSlice converts []any to []T.
TrimBlankLines removes any empty lines from the string.
TruncateString limits the string to the given length, adding an ellipsis if the string is being truncated, also handles newlines.
UnescapePropertyName replaces any propertyPathDotEscape occurrences with ".".