A pipeline is a virtual method for connecting goroutines and channels so that the output of one goroutine becomes the input of another goroutine using channels to transfer your data.
One of the benefits that you get from using pipelines is that there is a constant data flow in your program, as no goroutine and channel have to wait for everything to be completed in order to start their execution. Additionally, you use fewer variables and therefore less memory space because you do not have to save everything as a variable. Finally, the use of pipelines simplifies the design of the program and improves its maintainability.
Pipelines are going to be illustrated using the code of pipeline.go. This program will be presented in six parts. The task performed by the pipeline.go program is to generate random numbers in a given range and stop when any number in the random sequence...