by camdencheek · 3y ago · 0 comments
For example
out := MapSlice(
func(i int) string { return fmt.Sprintf("-=0x%02x=-", i) },
MapSlice(
func(i int) int { return i + 1 },
MapSlice(
func(i int) int { return i * i },
GenSlice(10, func(idx int) int { return idx }),
),
),
)
or piping workers out :=
WorkerPoolBackgroundClose(
WorkerPoolBackgroundClose(
WorkerPoolBackgroundClose(
GenChanNClose(3, func(idx int) int { return idx + 1 }),
func(i int) string { return strconv.Itoa(i) },
4),
func(s string) string { return ">" + s },
5,
),
func(s string) string { return " |" + s },
6)