#5175·go-zero

redis.Redis didn't implement redisNode interface

Author: yanrongliangCreated Sep 13, 2025Updated Sep 16, 2026
Labelsstale

Describe the bug 我需要使用BlpopCtx来消费list,发现redis.Redis无法作为BlpopCtx的参数RedisNode, 通过goland查看是redis.Redis没有实现部分方法

To Reproduce

  1. The code is
go
 node1, _ := redis.NewRedis(&redis.RedisConf{})
node2, _ := redis.NewRedis(&redis.RedisConf{})
node1.BlpopCtx(ctx, node2, "")
  1. The error is

    Cannot use node (type *Redis) as the type RedisNode
     Type does not implement RedisNode as some methods are missing:
     Pipeline() Pipeliner
     TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
     Command(ctx context.Context) *CommandsInfoCmd

**Expected behavior**
node2可以作为BlpopCtx的第二个参数

**Screenshots**

https://github.com/user-attachments/assets/4c095d9c-232c-4460-8218-f0e70364ea2b

**Environments (please complete the following information):**
 - OS: [macos]
 - go-zero version [v1.9.0]