File tree Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Original file line number Diff line number Diff line change
1
+ package redis
2
+
3
+ import "context"
4
+
5
+ func (c cmdable ) Do (ctx context.Context , args ... interface {}) * Cmd {
6
+ cmd := NewCmd (ctx , args )
7
+ _ = c (ctx , cmd )
8
+ return cmd
9
+ }
Original file line number Diff line number Diff line change
1
+ package redis_test
2
+
3
+ import (
4
+ . "github.com/bsm/ginkgo/v2"
5
+ . "github.com/bsm/gomega"
6
+
7
+ "github.com/redis/go-redis/v9"
8
+ )
9
+
10
+ var _ = Describe ("Do cmdble" , func () {
11
+ var client * redis.Client
12
+
13
+ BeforeEach (func () {
14
+ client = redis .NewClient (redisOptions ())
15
+ Expect (client .FlushDB (ctx ).Err ()).NotTo (HaveOccurred ())
16
+ })
17
+
18
+ AfterEach (func () {
19
+ client .Close ()
20
+ })
21
+
22
+ It ("should pong with Do cmd" , func () {
23
+ result := client .Conn ().Do (ctx , "PING" )
24
+ Expect (result .Result ()).To (Equal ("PONG" ))
25
+ Expect (result .Err ()).NotTo (HaveOccurred ())
26
+ })
27
+ })
Original file line number Diff line number Diff line change @@ -228,12 +228,6 @@ type UniversalClient interface {
228
228
PoolStats () * PoolStats
229
229
}
230
230
231
- func (c cmdable ) Do (ctx context.Context , args ... interface {}) * Cmd {
232
- cmd := NewCmd (ctx , args )
233
- _ = c (ctx , cmd )
234
- return cmd
235
- }
236
-
237
231
var (
238
232
_ UniversalClient = (* Client )(nil )
239
233
_ UniversalClient = (* ClusterClient )(nil )
You can’t perform that action at this time.
0 commit comments