Updating the Pipeline

Learn how to add more steps to the pipeline by instantiating a new step.

We’ve structured our code so we can add more steps to the pipeline by instantiating a new step and adding it to the pipeline slice. According to the initial plan, the next step in the pipeline is the execution of tests using the go test command. But before we add that step, we add a test file with a single test case to the add package we’re using for testing.

Let’s switch to the subdirectory testdata/tool, where we have the file add.go:

cd testdata/tool

Creating a test file

In this subdirectory, let’s create the test file add_test.go, and add a single test case to test the add() function:

Get hands-on with 1400+ tech skills courses.