utils

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppVersion

func AppVersion() string

func Append

func Append(res []string, values ...string) []string

func AppendMap

func AppendMap[K comparable, V any](values map[K]V, to *map[K]V)

func AppendMapWithResolving

func AppendMapWithResolving[K comparable, V any](values map[K]V, to *map[K]V, resolver func(key K, value1, value2 V) V)

func CNameToCamelName

func CNameToCamelName(s string) string

TODO - investigate if this function is good

func CopyMap

func CopyMap[K comparable, V any](m map[K]V) map[K]V

func DoLint

func DoLint(commentRight string) bool

func ExtractTLGenTag

func ExtractTLGenTag(comment string, tag string) (found bool, value string)

finds value for tags in comment with template {tag}:"{value}"

func FilterSlice

func FilterSlice[A any](in []A, f func(A) bool) (out []A)

func IsFirstBasicLatin

func IsFirstBasicLatin(str string) bool

func JsonPrettyPrint

func JsonPrettyPrint(in []byte) []byte

func Keys

func Keys[K comparable, V any](m map[K]V) (res []K)

unstable

func MapSlice

func MapSlice[A, B any](in []A, f func(A) B) (out []B)

func ParseHexToBytes

func ParseHexToBytes(data string) []byte

func ParseHexToBytesTL2

func ParseHexToBytesTL2(data string) []byte

func PutPairToSetOfPairs

func PutPairToSetOfPairs[K, V comparable](in *map[K]map[V]bool, k K, v V)

func ReverseSetOfPairs

func ReverseSetOfPairs[K, V comparable](in map[K]map[V]bool) map[V]map[K]bool

func SetIntersection

func SetIntersection[K comparable](s1, s2 map[K]bool) map[K]bool

func SetSubSets

func SetSubSets[T comparable](s map[T]bool) (values []map[T]bool)

WARINING: USE IF S IS SMALL AND IF YOU NOT FACE ALLOCATION PROBLEM

func SetToSlice

func SetToSlice[T comparable](s map[T]bool) []T

unstable

func SetUnion

func SetUnion[K comparable](s1, s2 map[K]bool) map[K]bool

func ShiftAll

func ShiftAll(s []string, shift string) []string

func SliceToMap

func SliceToMap[K comparable, T, V any](s []T, key func(T) K, value func(T) V) map[K]V

func SliceToSet

func SliceToSet[T comparable](s []T) map[T]bool

func SprintHexDump

func SprintHexDump(data []byte) string

func SprintHexDumpTL2

func SprintHexDumpTL2(data []byte) string

func ToLowerFirst

func ToLowerFirst(str string) string

func ToUpperFirst

func ToUpperFirst(str string) string

func Values

func Values[K comparable, V any](m map[K]V) (res []V)

unstable

func WalkDeterministic

func WalkDeterministic(fileExt string, root ...string) ([]string, error)

WalkDeterministic recursively walks through roots directories and returns all regular files with extension fileExt

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL