quii / learn-go-with-tests

Learn Go with test-driven development
MIT License
22.21k stars 2.81k forks source link

Handle the error returned by our updated Racer function #678

Closed mcncl closed 1 year ago

mcncl commented 1 year ago

In the Select chapter, after adding the error in the return from Racer we need to also update our original test to handle the error, else when we run the tests we will see:

/racer_test.go:24:16: assignment mismatch: 1 variable but Racer returns 2 values

Given we do nothing with it until later on, handling with _ makes the most sense.

I've included the initial test in full to demonstrate the change, and added a note for the reader to explain why this change needs to be made.