Modified put to put all dirty or marked items
This commit is contained in:
parent
9fee17a6a6
commit
2dbd664dd2
13 changed files with 329 additions and 167 deletions
9
internal/common/sliceutils/map.go
Normal file
9
internal/common/sliceutils/map.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue