(slice []T, mapper func(int, T) U)
| 1 | package slicetools |
| 2 | |
| 3 | func Map[T any, U any](slice []T, mapper func(int, T) U) []U { |
| 4 | result := make([]U, len(slice)) |
| 5 | for i, v := range slice { |
| 6 | result[i] = mapper(i, v) |
| 7 | } |
| 8 | return result |
| 9 | } |
nothing calls this directly
no outgoing calls
no test coverage detected