gatus icon indicating copy to clipboard operation
gatus copied to clipboard

refactor: Move client.InjectHTTPClient to client.Config

Open TwiN opened this issue 2 years ago • 1 comments

https://github.com/TwiN/gatus/blob/eb4e22e76b55107b285692829561eba5a8fe9d7e/client/client.go#L188

This effectively allows setting a global mocked HTTP client for testing purposes, which, while easy, prevents me from parallelizing the execution of some tests.

We should instead have it as a method of client.Config https://github.com/TwiN/gatus/blob/eb4e22e76b55107b285692829561eba5a8fe9d7e/client/config.go#L41

func (c *Config) InjectHTTPClient(client *http.Client) {
	c.httpClient = client
}

TwiN avatar Jan 08 '23 22:01 TwiN

@TwiN Can I try to solve this issue ?

vax-r avatar Aug 01 '23 03:08 vax-r