Versions in this module Expand all Collapse all v0 v0.7.6 Jun 15, 2024 Changes in this version + const LineDiffVersion + const NoStrPos + var ErrOverflow = errors.New("integer overflow") + var HexDigits = []byte + func AddInt(left, right int) (int, error) + func AddIntSlice(vals ...int) (int, error) + func AnsiGreenColor() string + func AnsiRedColor() string + func AnsiResetColor() string + func AppendNonZeroRandomBytes(b []byte, randLen int) []byte + func ApplyDiff(str1 string, diffBytes []byte) (string, error) + func ByteMapsEqual(m1 map[string][]byte, m2 map[string][]byte) bool + func ChunkSlice[T any](s []T, chunkSize int) [][]T + func CombineMaps[V any](m1 map[string]V, m2 map[string]V) + func CombineStrArrays(sarr1 []string, sarr2 []string) []string + func ContainsStr(strs []string, test string) bool + func CopyToChannel(outputCh chan<- []byte, reader io.Reader) error + func CopyWithEndBytes(outputBuf *bytes.Buffer, reader io.Reader, endBytes []byte) (bool, error) + func DecodeStringArray(barr []byte) ([]string, error) + func DecodeStringMap(barr []byte) (map[string]string, error) + func DetectMimeType(path string) string + func EllipsisStr(s string, maxLen int) string + func EncodeStringArray(arr []string) []byte + func EncodeStringMap(m map[string]string) []byte + func EncodedStringArrayGetFirstVal(encoded []byte) string + func EncodedStringArrayHasFirstVal(encoded []byte, firstKey string) bool + func GetBool(v interface{}, field string) bool + func GetCmdExitCode(cmd *exec.Cmd, err error) int + func GetExitCode(err error) int + func GetFirstLine(s string) string + func GetMapKeys[K comparable, V any](m map[K]V) []K + func GetOrderedMapKeys[V any](m map[string]V) []string + func GetOrderedStringerMapKeys[K interface{ ... }, V any](m map[K]V) []K + func GetStrArr(v interface{}, field string) []string + func IncSyncMap[K comparable, V int | int64](sm *SyncMap[K, V], key K, incAmt V) + func IsPrefix(strs []string, test string) bool + func LongestPrefix(root string, strs []string) string + func MakeDiff(str1 string, str2 string) []byte + func NullDecodeStr(barr []byte) (string, error) + func NullEncodeStr(s string) []byte + func QuickJson(v interface{}) string + func QuickParseJson[T any](s string) T + func Sha1Hash(data []byte) string + func ShellHexEscape(s string) string + func ShellQuote(val string, forceQuote bool, maxLen int) string + func SortStringRunes(s string) string + func StrArrayToMap(sarr []string) map[string]bool + func StrMapsEqual(m1 map[string]string, m2 map[string]string) bool + func StrsEqual(s1arr []string, s2arr []string) bool + type LineDiffType struct + Lines []int + NewData []string + type StrWithPos struct + Pos int + Str string + func ParseToSP(s string) StrWithPos + func (sp StrWithPos) Append(str string) StrWithPos + func (sp StrWithPos) Prepend(str string) StrWithPos + func (sp StrWithPos) String() string + type SyncMap struct + func MakeSyncMap[K comparable, V any]() *SyncMap[K, V] + func (sm *SyncMap[K, V]) Clear() + func (sm *SyncMap[K, V]) Delete(k K) + func (sm *SyncMap[K, V]) Get(k K) V + func (sm *SyncMap[K, V]) GetEx(k K) (V, bool) + func (sm *SyncMap[K, V]) Keys() []K + func (sm *SyncMap[K, V]) Len() int + func (sm *SyncMap[K, V]) Replace(newMap map[K]V) + func (sm *SyncMap[K, V]) Set(k K, v V)