Modified put to put all dirty or marked items

This commit is contained in:
Leon Mika 2022-07-16 11:35:53 +10:00
parent 9fee17a6a6
commit 2dbd664dd2
13 changed files with 329 additions and 167 deletions

View file

@ -0,0 +1,9 @@
package sliceutils
func Map[T, U any](ts []T, fn func(t T) U) []U {
us := make([]U, len(ts))
for i, t := range ts {
us[i] = fn(t)
}
return us
}