18 lines
420 B
Go
18 lines
420 B
Go
package mocks
|
|
|
|
import "net/http"
|
|
|
|
// MockClient is the mock HTTP client used for tests
|
|
type MockClient struct {
|
|
DoFunc func(req *http.Request) (*http.Response, error)
|
|
}
|
|
|
|
var (
|
|
// GetDoFunc fetches the mock client's `Do` func
|
|
GetDoFunc func(req *http.Request) (*http.Response, error)
|
|
)
|
|
|
|
// Do is the mock client's `Do` func
|
|
func (m *MockClient) Do(req *http.Request) (*http.Response, error) {
|
|
return GetDoFunc(req)
|
|
}
|