Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This week we focused on channels, concurrency and parallelism and created a program that introduced these different topics. Included in this Pull Request are 6 different files named: manager.go, employee.go, employee_test.go, errors.go, manager_test.go, product.go and completed_product.go. The goal of this pull request was to create tests for the given files that cover a minimum of 90% coverage. This pull request was created to include a sample product factory. In order to create a product factory we needed to include a manager that will be the overall boss of the employees and receives orders for the products. The manager will assign the products to different employees to build, complete and send back to the manager before continuing on to a new product. Once the product was completed and sent back to the manager, the manager will then send the completed product back to the customer.
In order for this to be split up and organized in the best way possible, I made separate files for the employee, product and the manager. Because we were learning about concurrency and parallelism we needed to include those into the program as well. In order to be concurrent in this program, each employee could only focus on one product at a time and therefore we needed more employees in order to manage multiple products at one time for the most accurate products in the fastest time.
Inside the employee_test.go file we needed to include a good amount of variables and details in here to cover all of the possibilities. First and foremost I needed to include both a good employee and a bad employee. One employee is consistent and will finish the product while the bad employee will not complete the product. We also needed a variable that will define if an employee accepts or denies a product. Inside of here I had to include a cancel jobs option for the employee and I had to include a done option for when an employee finishes up a job. In addition to this I had to create a new variable that will either have an error or no errors according to the created product from the employee.
A lot of the difficulties that I ran into mostly dealt with organizing all of the different variables in a way that made it easy for me to understand and put together in the most logical way. I also had difficulties deciding when, where and why I would be including the concurrency model into the program. I had to go back to the notes over and over again to grasp the concept and put it into action.