Skip to content

Commit cd7e398

Browse files
Swap returns of new function NewMockedHTTPClientAndServer
1 parent 060ff3d commit cd7e398

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mock/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (efrt *EnforceHostRoundTripper) RoundTrip(r *http.Request) (*http.Response,
164164
//
165165
// c := github.NewClient(mockedHTTPClient)
166166
func NewMockedHTTPClient(options ...MockBackendOption) *http.Client {
167-
_, c := NewMockedHTTPClientAndServer(options...)
167+
c, _ := NewMockedHTTPClientAndServer(options...)
168168

169169
return c
170170
}
@@ -175,7 +175,7 @@ func NewMockedHTTPClient(options ...MockBackendOption) *http.Client {
175175
// This avoids creating a breaking change, for now.
176176
//
177177
// To close the server, use: `mockServer.Close()`.
178-
func NewMockedHTTPClientAndServer(options ...MockBackendOption) (*httptest.Server, *http.Client) {
178+
func NewMockedHTTPClientAndServer(options ...MockBackendOption) (*http.Client, *httptest.Server) {
179179
router := mux.NewRouter()
180180

181181
router.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -199,5 +199,5 @@ func NewMockedHTTPClientAndServer(options ...MockBackendOption) (*httptest.Serve
199199
UpstreamRoundTripper: mockServer.Client().Transport,
200200
}
201201

202-
return mockServer, c
202+
return c, mockServer
203203
}

0 commit comments

Comments
 (0)