Using Table-Driven Tests
This lesson explains a method to organize the testing of Go programs via tables.
We'll cover the following...
We'll cover the following...
When writing tests, it is good practice to use an array to collect the test-inputs and the expected results together. Each entry in the table then becomes a complete test case with inputs and expected results, and sometimes with additional information such as a test name to make the test output more informative.
The actual test simply ...