February 2018
Intermediate to advanced
340 pages
9h 43m
English
For the testing of the Handler or HandlerFunc, the net/http/httptest could be leveraged. This package provides the struct ResponseRecorder that is able to record the content of the response and provide it back for asserting the values. For assembling the request, the NewRequest function of the net/http package is used.
Read now
Unlock full access