I am using go-redis package. I fired below query:
rd.LLen("queue_1")
Which returning me below result with type *redis.IntCmd
:
llen queue_1: 100001
Count is perfect but I want only count with type of int
. Can anyone help?
I am using go-redis package. I fired below query:
rd.LLen("queue_1")
Which returning me below result with type *redis.IntCmd
:
llen queue_1: 100001
Count is perfect but I want only count with type of int
. Can anyone help?
the LLen
func looks like: func (c *cmdable) LLen(key string) *IntCmd
So it returns an IntCmd
type. IntCmd
provides this function: func (cmd *IntCmd) Val() int64
So you can do e.g.
cmd := rd.LLen("queue_1")
i := cmd.Val() //i will be an int64 type