Middlewares
This commit is contained in:
9
backend/utils/map.go
Normal file
9
backend/utils/map.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package utils
|
||||
|
||||
func Map[T any, U any](input []T, fn func(T) U) []U {
|
||||
var result []U
|
||||
for _, v := range input {
|
||||
result = append(result, fn(v))
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user