make application with base logic

This commit is contained in:
Gitea
2023-11-26 15:39:34 +03:00
parent 0553ea71c3
commit 606b94e35b
32 changed files with 1070 additions and 27 deletions

11
pkg/slices/map.go Normal file
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
}