Skip to content

Commit

Permalink
Merge pull request #232 from EasyPost/io
Browse files Browse the repository at this point in the history
fix: deprecated calls to ioutil.NopCloser
  • Loading branch information
Justintime50 committed Aug 9, 2024
2 parents be4503f + 3479f47 commit 09021fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/error_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package easypost_test

import (
"io/ioutil"
"io"
"net/http"
"strings"

Expand Down Expand Up @@ -40,7 +40,7 @@ func (c *ClientTests) TestApiErrorStatusCodes() {

res := &http.Response{
StatusCode: 0,
Body: ioutil.NopCloser(strings.NewReader("")),
Body: io.NopCloser(strings.NewReader("")),
}

res.StatusCode = 0
Expand Down Expand Up @@ -198,7 +198,7 @@ func (c *ClientTests) TestApiErrorMessageParseArray() {

res := &http.Response{
StatusCode: 422,
Body: ioutil.NopCloser(strings.NewReader(fakeErrorResponse)),
Body: io.NopCloser(strings.NewReader(fakeErrorResponse)),
}

err := easypost.BuildErrorFromResponse(res)
Expand All @@ -225,7 +225,7 @@ func (c *ClientTests) TestErrorMessageParseMap() {

res := &http.Response{
StatusCode: 422,
Body: ioutil.NopCloser(strings.NewReader(fakeErrorResponse)),
Body: io.NopCloser(strings.NewReader(fakeErrorResponse)),
}

err := easypost.BuildErrorFromResponse(res)
Expand Down Expand Up @@ -264,7 +264,7 @@ func (c *ClientTests) TestErrorMessageParseExtreme() {

res := &http.Response{
StatusCode: 422,
Body: ioutil.NopCloser(strings.NewReader(fakeErrorResponse)),
Body: io.NopCloser(strings.NewReader(fakeErrorResponse)),
}

err := easypost.BuildErrorFromResponse(res)
Expand Down

0 comments on commit 09021fd

Please sign in to comment.