Skip to content

Commit

Permalink
Merge pull request #3 from tsawler/development
Browse files Browse the repository at this point in the history
comments
  • Loading branch information
tsawler authored Mar 31, 2022
2 parents f689e0c + 5475fdd commit 2f716c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
"testing"
)

// RoundTripFunc .
// RoundTripFunc is used to satisfy the interface requirements for http.Client
type RoundTripFunc func(req *http.Request) *http.Response

// RoundTrip .
// RoundTrip is used to satisfy the interface requirements for http.Client
func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) {
return f(req), nil
}

//NewTestClient returns *http.Client with Transport replaced to avoid making real calls
// NewTestClient returns *http.Client with Transport replaced to avoid making real calls
func NewTestClient(fn RoundTripFunc) *http.Client {
return &http.Client{
Transport: RoundTripFunc(fn),
Expand Down

0 comments on commit 2f716c4

Please sign in to comment.