components/resolver: Use database instead of file approach
This commit is contained in:
parent
f6b38f055d
commit
32107265d4
10 changed files with 165 additions and 103 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue