Skip to content

Commit c5438f8

Browse files
committed
.
1 parent 47774a8 commit c5438f8

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

pkg/http/marshall_message_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package http_test
22

33
import (
44
"encoding/json"
5-
"io/ioutil"
65
"net/http"
76
"testing"
87

@@ -36,7 +35,7 @@ func TestDefaultMarshalMessageFunc(t *testing.T) {
3635

3736
assert.Equal(t, url, req.URL.String())
3837

39-
body, err := ioutil.ReadAll(req.Body)
38+
body, err := io.ReadAll(req.Body)
4039
require.NoError(t, err)
4140
assert.Equal(t, msgPayload, body)
4241

pkg/http/publisher.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package http
33
import (
44
"bytes"
55
"encoding/json"
6-
"io/ioutil"
76
"net/http"
87

98
"github.com/pkg/errors"
@@ -146,7 +145,7 @@ func (p Publisher) handleResponseBody(resp *http.Response, logFields watermill.L
146145
return nil
147146
}
148147

149-
body, err := ioutil.ReadAll(resp.Body)
148+
body, err := io.ReadAll(resp.Body)
150149
if err != nil {
151150
return errors.Wrap(err, "could not read response body")
152151
}

pkg/http/sse_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"encoding/json"
88
"errors"
99
"io"
10-
"io/ioutil"
1110
netHTTP "net/http"
1211
"net/http/httptest"
1312
"strings"
@@ -75,7 +74,7 @@ func TestSSE(t *testing.T) {
7574
require.NoError(t, err)
7675

7776
require.Equal(t, 200, resp.StatusCode)
78-
body, err := ioutil.ReadAll(resp.Body)
77+
body, err := io.ReadAll(resp.Body)
7978
require.NoError(t, err)
8079

8180
post := Post{}

pkg/http/subscriber.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package http
33
import (
44
"context"
55
"encoding/json"
6-
"io/ioutil"
76
"net"
87
"net/http"
98
"strings"
@@ -21,7 +20,7 @@ type UnmarshalMessageFunc func(topic string, request *http.Request) (*message.Me
2120
// DefaultUnmarshalMessageFunc retrieves the UUID and Metadata from request headers,
2221
// as encoded by DefaultMarshalMessageFunc.
2322
func DefaultUnmarshalMessageFunc(topic string, req *http.Request) (*message.Message, error) {
24-
body, err := ioutil.ReadAll(req.Body)
23+
body, err := io.ReadAll(req.Body)
2524
if err != nil {
2625
return nil, err
2726
}

0 commit comments

Comments
 (0)