gomodule / redigo

Go client for Redis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HSET command is having issue with the return type (reply return variable) : unexpected type for String, got type int64

LokeshReddy63 opened this issue · comments

Ask questions at https://stackoverflow.com/questions/ask?tags=go+redis

if _, err := redis.String(conn.Do("HSET", redis.Args{}.Add("testkey:1").AddFlat(newUser)...)); err != nil {
		log.Panic(err)
	}
	values, err := redis.Values(conn.Do("HGETALL", "testkey:1"))

error that redigo is giving me

redigo: unexpected type for String, got type int64

I tried running the same command from cli and I see that its returning int64 , but redigo isn't expecting that. instead its expecting a string. basically HMSET returns string but this is deprecated , so i think we might need to use HSET instead of HMSET.

let me know if anyone need much information !!

please close , my bad , I have to use redis.Int64 instead of redis.String in the above code snippet.

Sorry !