v0.0.342 support json data in enum comment
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m29s

This commit is contained in:
2023-12-07 17:57:06 +01:00
parent b0be93a7a0
commit f042183433
9 changed files with 227 additions and 34 deletions

View File

@@ -29,6 +29,14 @@ func ArrToMap[T comparable, V any](a []V, keyfunc func(V) T) map[T]V {
return result
}
func ArrToKVMap[T any, K comparable, V any](a []T, keyfunc func(T) K, valfunc func(T) V) map[K]V {
result := make(map[K]V, len(a))
for _, v := range a {
result[keyfunc(v)] = valfunc(v)
}
return result
}
func ArrToSet[T comparable](a []T) map[T]bool {
result := make(map[T]bool, len(a))
for _, v := range a {