Skip to main content Link Search Menu Expand Document (external link)

Map

func Map[T any, R any](input *Channel[T], mapper func(T) R, opts ...options.MapOption) *Channel[R]

Map transforms every input value with a mapper function and sends the results to the output channel.

Example

output := Map(input, func(i int) int { return i * 10 })