brandur/redis-cell

A redis-cell Questions about strings

Edelweiss-Snow opened this issue · 0 comments

I have ran into a problem using redis-cell. As shown in the code, passing a string variable will throw an error of "Cell error: invalid digit found in string" but passing a string literal does the job.
To my knowledge, using a string variable should be the same as using a string literal. Is there any different interpretation in redis-cell or is there any difference in golang that causes this problem?
How can I use a string variable?
Thanks

func test() {
key := "example"
cli := redis.NewClient(&redis.Options{
Addr: "127.0.0.1:6379",
Password: "",
DB: 0,
})
_, err := cli.Ping().Result()
if err != nil {
return nil, fmt.Errorf("redis ping failed,err is:%s", err.Error())
}
_, err = control.redisCli.Do("cl.throttle", key, 89, 90, 10, 1).Result() //fail,this err is "Cell error: invalid digit found in string"
if err != nil {
return
}
_, err = control.redisCli.Do("cl.throttle", "111" + key, 89, 90, 10, 1).Result() // success
if err != nil {
return
}
_, err = control.redisCli.Do("cl.throttle", "example", 89, 90, 10, 1).Result() //success
if err != nil {
return
}
return
}