Skip to content

Commit

Permalink
rename MyReader
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeatdell committed Feb 25, 2025
1 parent f0ab9ff commit a0d31f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ import (

type stubTypeWithMetaData struct{}

// MyReader is an io.ReadCloser implementation for writing
// httpBodyReadCloser is an io.ReadCloser implementation for writing
// the body of an http request
type MyReader struct {
type httpBodyReadCloser struct {
reader io.Reader
}

func (r *MyReader) Read(p []byte) (int, error) {
func (r *httpBodyReadCloser) Read(p []byte) (int, error) {
return r.reader.Read(p)
}

func (r *MyReader) Close() error {
func (r *httpBodyReadCloser) Close() error {
return nil
}

Expand Down Expand Up @@ -473,7 +473,7 @@ func TestDoAndGetResponseBody(t *testing.T) {
method: http.MethodPost,
uri: "/test",
headers: map[string]string{"Custom-Header": "application/json"},
body: &MyReader{
body: &httpBodyReadCloser{
reader: strings.NewReader("Success"),
},
mockResponse: &http.Response{
Expand Down

0 comments on commit a0d31f3

Please sign in to comment.