Hello @benbjohnson , I recently came across your article while trying to learn about how to test HTTP packages in Golang, and I think what you did was amazing.
What I found out
However, the test file content you provided was not fully testing all the scenarios in the function, as I ran the tests and it recorded an 83.3% coverage of the statements.
What I did
-
I then proceeded to try to generate the coverage file, and just as I suspected, the statement that had not been tested was the return nil part.
-
I added the test scenario, and now we have a complete 100% coverage on the test.
Conclusion
- As I have seen some issues have been created and have stayed open for about half a decade now, I would like to know if it is still being maintained, to add my Pull request to the repository.
Hello @benbjohnson , I recently came across your article while trying to learn about how to test HTTP packages in Golang, and I think what you did was amazing.
What I found out
However, the test file content you provided was not fully testing all the scenarios in the function, as I ran the tests and it recorded an
83.3%coverage of the statements.What I did
I then proceeded to try to generate the coverage file, and just as I suspected, the statement that had not been tested was the
return nilpart.I added the test scenario, and now we have a complete
100%coverage on the test.Conclusion