Skip to content

Commit a70913a

Browse files
authored
Bump dependencies (#19)
1 parent 29a469f commit a70913a

5 files changed

Lines changed: 23 additions & 27 deletions

File tree

go.mod

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
module github.com/ThreeDotsLabs/watermill-http/v2
22

3-
go 1.21
4-
5-
toolchain go1.23.0
3+
go 1.25.0
64

75
require (
8-
github.com/ThreeDotsLabs/watermill v1.3.7
9-
github.com/go-chi/chi/v5 v5.2.3
6+
github.com/ThreeDotsLabs/watermill v1.5.2
7+
github.com/go-chi/chi/v5 v5.2.5
108
github.com/go-chi/render v1.0.3
119
github.com/pkg/errors v0.9.1
12-
github.com/stretchr/testify v1.9.0
10+
github.com/stretchr/testify v1.11.1
1311
)
1412

1513
require (
16-
github.com/ajg/form v1.5.1 // indirect
14+
github.com/ajg/form v1.7.1 // indirect
1715
github.com/davecgh/go-spew v1.1.1 // indirect
1816
github.com/google/uuid v1.6.0 // indirect
19-
github.com/hashicorp/errwrap v1.1.0 // indirect
20-
github.com/hashicorp/go-multierror v1.1.1 // indirect
2117
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
2218
github.com/oklog/ulid v1.3.1 // indirect
2319
github.com/pmezard/go-difflib v1.0.0 // indirect

go.sum

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
github.com/ThreeDotsLabs/watermill v1.3.7 h1:NV0PSTmuACVEOV4dMxRnmGXrmbz8U83LENOvpHekN7o=
2-
github.com/ThreeDotsLabs/watermill v1.3.7/go.mod h1:lBnrLbxOjeMRgcJbv+UiZr8Ylz8RkJ4m6i/VN/Nk+to=
3-
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
1+
github.com/ThreeDotsLabs/watermill v1.5.2 h1:0ES33Eq1jEsP/pWvtE4n8bE0bs+9Jq7boT7wGBCVY6Q=
2+
github.com/ThreeDotsLabs/watermill v1.5.2/go.mod h1:i9/968UriGphWfEbfMuYSD1qFbYRjb0mE0r+rV0FPp4=
43
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
4+
github.com/ajg/form v1.7.1 h1:OsnBDzTkrWdrxvEnO68I72ZVGJGNaMwPhoAm0V+llgc=
5+
github.com/ajg/form v1.7.1/go.mod h1:HL757PzLyNkj5AIfptT6L+iGNeXTlnrr/oDePGc/y7Q=
56
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
67
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7-
github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE=
8-
github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
8+
github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
9+
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
910
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
1011
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
1112
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
1213
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
1314
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
14-
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
15-
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
16-
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
17-
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
18-
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
1915
github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8=
2016
github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts=
2117
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
@@ -24,8 +20,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
2420
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
2521
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2622
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
27-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
28-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
23+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
24+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
2925
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
3026
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3127
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

pkg/http/publisher.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ func (p *Publisher) Close() error {
136136
}
137137

138138
func (p Publisher) handleResponseBody(resp *http.Response, logFields watermill.LogFields) error {
139-
defer resp.Body.Close()
139+
defer func() {
140+
_ = resp.Body.Close()
141+
}()
140142

141143
if resp.StatusCode < http.StatusBadRequest {
142144
return nil

pkg/http/sse_responder.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (s sseResponder) channelEventStream(w http.ResponseWriter, r *http.Request,
117117
var err error
118118
event, err = s.marshaler.Marshal(ctx, v)
119119
if err != nil {
120-
_, _ = w.Write([]byte(fmt.Sprintf("event: error\ndata: {\"error\":\"%v\"}\n\n", err)))
120+
_, _ = fmt.Fprintf(w, "event: error\ndata: {\"error\":\"%v\"}\n\n", err)
121121
if f, ok := w.(http.Flusher); ok {
122122
f.Flush()
123123
}
@@ -127,7 +127,7 @@ func (s sseResponder) channelEventStream(w http.ResponseWriter, r *http.Request,
127127

128128
data := strings.Join(strings.Split(string(event.Data), "\n"), "\ndata: ")
129129

130-
_, _ = w.Write([]byte(fmt.Sprintf("event: %s\ndata: %s\n\n", event.Event, data)))
130+
_, _ = fmt.Fprintf(w, "event: %s\ndata: %s\n\n", event.Event, data)
131131
if f, ok := w.(http.Flusher); ok {
132132
f.Flush()
133133
}
@@ -176,7 +176,7 @@ var (
176176

177177
func renderer(w http.ResponseWriter, r *http.Request, v render.Renderer) error {
178178
rv := reflect.ValueOf(v)
179-
if rv.Kind() == reflect.Ptr {
179+
if rv.Kind() == reflect.Pointer {
180180
rv = rv.Elem()
181181
}
182182

@@ -212,7 +212,7 @@ func renderer(w http.ResponseWriter, r *http.Request, v render.Renderer) error {
212212

213213
func isNil(f reflect.Value) bool {
214214
switch f.Kind() {
215-
case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
215+
case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer, reflect.Slice:
216216
return f.IsNil()
217217
default:
218218
return false

pkg/http/sse_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ func newSSERequest(t *testing.T, ctx context.Context, url string) chan []byte {
219219

220220
go func() {
221221
defer close(responsesChan)
222-
defer resp.Body.Close()
222+
defer func() {
223+
_ = resp.Body.Close()
224+
}()
223225

224226
for {
225227
line, err := br.ReadBytes('\n')

0 commit comments

Comments
 (0)