gonjalla/mocks/mocks.go
2020-05-07 11:31:10 +02:00

19 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)
}