gonjalla/mocks/mocks.go

19 lines
420 B
Go
Raw Permalink Normal View History

2020-05-04 21:35:17 +00:00
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)
}