able to list products

This commit is contained in:
Gitea
2023-11-23 19:13:54 +03:00
parent f382d9e73b
commit 0553ea71c3
11 changed files with 774 additions and 116 deletions

View File

@ -0,0 +1,11 @@
package slices
// Map slice from one type to another one.
func Map[S any, E any](s []S, f func(S) E) []E {
out := make([]E, len(s))
for i := range s {
out[i] = f(s[i])
}
return out
}