Junior — Senior
Number processing pipeline in goroutines with instant output
livecode
Task condition
The task involves two goroutines and two channels. The first channel (sourceChan) receives a stream of numbers. The second goroutine reads data from sourceChan (for example, multiplies each number by 2) and sends the results to the second channel (resultChan). The main goroutine (main) should output the values from resultChan as they appear and, after processing is complete, output an aggregated total (for example, the sum of all received numbers).