Mocking Http requests in go

Mocking http retries behavior As we know, http requests can fail for a large variety of reasons, client side or server side (unauthorized, timeouts etc). On the client side a common approach is to retry request by increasing the waiting time between retries. Is this scenario be easily unit test? Unit Testing In golang there is this cool library Simple mocking of an http endpoint: func TestMockHttpResponse(t *testing.T) { httpmock.Activate() defer httpmock....

April 10, 2023 · 1 min · Nolan