Solution: Write Code with a Pipeline Pattern
Check the solution to the challenge to use the pipeline pattern.
We'll cover the following...
Problem breakdown
Let’s break the question statement to write the complete code:
generateData
The first step consists of reading the data from the CSV file and passing it into the channel.
- An error will be thrown if it’s not possible to open the file.
Press + to interact
f, err := os.Open(filename)if err != nil {return nil, errors.New(filename)}
-
Create an array of strings to store the record read from the file.
-
Loop over the file until we reach the
EOF
and pass ...