Closed
Description
Version: github.com/go-redis/redis/v8 v8.11.4
Hi, I found the test case(https://github.com/go-redis/redis/blob/e061db8c13fd6b5e007d73370873026e360719de/redis_test.go#L274),`time.Time` can be scanned to object. But it's wrong when I used it in hmget(...).scan(&u)
type User struct {
Name string `json:"name" redis:"name"`
Age int64 `json:"age" redis:"age"`
CreateAt time.Time `json:"createAt" redis:"createAt"`
}
func main() {
......
fmt.Println(cli.HMSet(ctx, "joe", map[string]interface{}{
"name": "joe",
"age": 10,
"createAt": time.Now(),
}).Result())
u := User{}
fmt.Println(cli.HMGet(ctx, "joe", "name", "age", "city", "createAt").Scan(&u))
fmt.Println(u)
......
}
Metadata
Metadata
Assignees
Labels
No labels