@@ -12,10 +12,10 @@ import (
12
12
"testing"
13
13
"time"
14
14
15
- "github.com/go-redis/redis/v8"
16
-
17
15
. "github.com/onsi/ginkgo"
18
16
. "github.com/onsi/gomega"
17
+
18
+ "github.com/go-redis/redis/v8"
19
19
)
20
20
21
21
const (
@@ -117,7 +117,7 @@ func TestGinkgoSuite(t *testing.T) {
117
117
RunSpecs (t , "go-redis" )
118
118
}
119
119
120
- //------------------------------------------------------------------------------
120
+ // ------------------------------------------------------------------------------
121
121
122
122
func redisOptions () * redis.Options {
123
123
return & redis.Options {
@@ -364,7 +364,7 @@ func startSentinel(port, masterName, masterPort string) (*redisProcess, error) {
364
364
return p , nil
365
365
}
366
366
367
- //------------------------------------------------------------------------------
367
+ // ------------------------------------------------------------------------------
368
368
369
369
type badConnError string
370
370
@@ -373,14 +373,28 @@ func (e badConnError) Timeout() bool { return true }
373
373
func (e badConnError ) Temporary () bool { return false }
374
374
375
375
type badConn struct {
376
- net.TCPConn
377
-
378
376
readDelay , writeDelay time.Duration
379
377
readErr , writeErr error
380
378
}
381
379
382
380
var _ net.Conn = & badConn {}
383
381
382
+ func (cn * badConn ) Close () error {
383
+ return nil
384
+ }
385
+
386
+ func (cn * badConn ) LocalAddr () net.Addr {
387
+ return & net.TCPAddr {}
388
+ }
389
+
390
+ func (cn * badConn ) RemoteAddr () net.Addr {
391
+ return & net.TCPAddr {}
392
+ }
393
+
394
+ func (cn * badConn ) SetDeadline (t time.Time ) error {
395
+ return nil
396
+ }
397
+
384
398
func (cn * badConn ) SetReadDeadline (t time.Time ) error {
385
399
return nil
386
400
}
@@ -409,7 +423,7 @@ func (cn *badConn) Write([]byte) (int, error) {
409
423
return 0 , badConnError ("bad connection" )
410
424
}
411
425
412
- //------------------------------------------------------------------------------
426
+ // ------------------------------------------------------------------------------
413
427
414
428
type hook struct {
415
429
beforeProcess func (ctx context.Context , cmd redis.Cmder ) (context.Context , error )
0 commit comments