quii / learn-go-with-tests

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

Select lesson clarity about defer and test execution #679

Open mud5150 opened 1 year ago

mud5150 commented 1 year ago

In the select lesson, it might be worth pointing out that defer slowServer.Close() in TestRacer() will take as long as the longest timeout. This is eluded to, but I immediately thought I had done something wrong since the test blocked for the amount of time of the slowest http response. On the upside, it was a good learning experience to figure it out.

P.S. These lessons are great. Thanks for putting this together.