cleanup: remove redundant HTTPClient definition (#643)
This counts as a follow-up cleanup as part of doing https://github.com/ooni/probe/issues/1885.
This commit is contained in:
@@ -40,10 +40,7 @@ type templateExecutor interface {
|
||||
// http.DefaultClient as the default HTTPClient used by Client.
|
||||
// Consumers of this package typically provide a custom HTTPClient
|
||||
// with additional functionality (e.g., DoH, circumvention).
|
||||
type HTTPClient interface {
|
||||
// Do should work like http.Client.Do.
|
||||
Do(req *http.Request) (*http.Response, error)
|
||||
}
|
||||
type HTTPClient = model.HTTPClient
|
||||
|
||||
// GobCodec is a Gob encoder and decoder. Generally, we use a
|
||||
// default GobCodec in Client. This is the interface to implement
|
||||
|
||||
@@ -41,6 +41,8 @@ func (c *FakeHTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
return c.Resp, nil
|
||||
}
|
||||
|
||||
func (c *FakeHTTPClient) CloseIdleConnections() {}
|
||||
|
||||
type FakeBody struct {
|
||||
Data []byte
|
||||
Err error
|
||||
|
||||
@@ -19,3 +19,5 @@ func (c *VerboseHTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
c.T.Logf("< %d", resp.StatusCode)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (c *VerboseHTTPClient) CloseIdleConnections() {}
|
||||
|
||||
Reference in New Issue
Block a user