e89aef57cb
* CloudMigrations: add slicesext.Map function to simplify dto creation * CloudMigrations: wire ngalert to cloud migration service
12 lines
168 B
Go
12 lines
168 B
Go
package slicesext
|
|
|
|
func Map[T any, U any](xs []T, f func(T) U) []U {
|
|
out := make([]U, 0, len(xs))
|
|
|
|
for _, x := range xs {
|
|
out = append(out, f(x))
|
|
}
|
|
|
|
return out
|
|
}
|