← All Exercises
Go Channel Communication
intermediatego
Background
Channels are Go concurrency primitive for safe data passing between goroutines, following CSP principles.
Problem
Write a Go function that uses a channel to pipeline data through a filter and transformer stage concurrently.
Input
A slice of integers to process through the pipeline.
Output
A slice of transformed and filtered integers.
Sample tests
Sample 1
Input: [1, -2, 3, -4, 5]
Expected: [2, 6, 10]
Your solution
Learning objective
Learn channel creation, closing, range-over-channel, and pipeline patterns.