components/resolver: Use database instead of file approach

This commit is contained in:
Tom Wiesing 2022-10-05 16:35:47 +02:00
parent f6b38f055d
commit 32107265d4
No known key found for this signature in database
10 changed files with 165 additions and 103 deletions

View file

@ -49,6 +49,15 @@ func Filter[T any](values []T, filter func(T) bool) []T {
return results
}
// AsAny returns the same slice as values, but as any
func AsAny[T any](values []T) []any {
results := make([]any, len(values))
for i, v := range values {
results[i] = v
}
return results
}
// Partition partitions values in T by the given functions.
func Partition[T any, P comparable](values []T, partition func(value T) P) map[P][]T {
result := make(map[P][]T)