Skip to content

Commit aaf2323

Browse files
use constants
1 parent a6ecd95 commit aaf2323

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ require (
88
)
99

1010
require (
11-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
11+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1212
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
1313
github.com/go-redsync/redsync/v4 v4.13.0 // indirect
1414
github.com/google/go-cmp v0.5.9 // indirect
1515
github.com/hashicorp/errwrap v1.1.0 // indirect
1616
github.com/hashicorp/go-multierror v1.1.1 // indirect
17-
github.com/redis/go-redis/v9 v9.7.0 // indirect
17+
github.com/redis/go-redis/v9 v9.7.1 // indirect
1818
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
88
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
99
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
1010
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
11+
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
12+
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
1113
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1214
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1315
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
@@ -33,6 +35,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3335
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3436
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
3537
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
38+
github.com/redis/go-redis/v9 v9.7.1 h1:4LhKRCIduqXqtvCUlaq9c8bdHOkICjDMrr1+Zb3osAc=
39+
github.com/redis/go-redis/v9 v9.7.1/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
3640
github.com/redis/rueidis v1.0.19 h1:s65oWtotzlIFN8eMPhyYwxlwLR1lUdhza2KtWprKYSo=
3741
github.com/redis/rueidis v1.0.19/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo=
3842
github.com/sony/gobreaker/v2 v2.1.0 h1:av2BnjtRmVPWBvy5gSFPytm1J8BmN5AGhq875FfGKDM=

test/http-client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestNoResiliencyFeatures5xxError(t *testing.T) {
7878
resp, err := client.Do(request)
7979
assert.NilError(t, err)
8080
assert.Equal(t, 1, *calls, "expected 1 call")
81-
assert.Equal(t, 500, resp.StatusCode, "expected http-500")
81+
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode, "expected http-500")
8282
}
8383

8484
func TestNumberOfRequestsIs4For5xx(t *testing.T) {
@@ -109,7 +109,7 @@ func TestNumberOfRequestsIs1For5xxAndZeroRetry(t *testing.T) {
109109
client := ehttpclient.Create(10*time.Millisecond, ehttpclient.WithRetry(0, time.Millisecond))
110110
resp, err := client.Do(request)
111111
assert.NilError(t, err)
112-
assert.Equal(t, 500, resp.StatusCode, "expected http-500")
112+
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode, "expected http-500")
113113
assert.Equal(t, 1, *calls, "expected 1 call")
114114
}
115115

@@ -164,7 +164,7 @@ func TestCircuitBreaker(t *testing.T) {
164164
client := ehttpclient.Create(200*time.Millisecond, ehttpclient.WithCircuitBreaker(1, 1, time.Second, time.Second))
165165
resp, err1 := client.Do(request)
166166
assert.NilError(t, err1)
167-
assert.Equal(t, 500, resp.StatusCode, "expected http-500")
167+
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode, "expected http-500")
168168
for i := 0; i < 10; i++ {
169169
_, err := client.Do(request)
170170
assert.ErrorIs(t, err, gobreaker.ErrOpenState)

0 commit comments

Comments
 (0)