1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Add scan struct example (#1870)

This commit is contained in:
Vladimir Mihailenco
2021-08-29 19:37:17 +03:00
committed by GitHub
parent 989295a24b
commit ed42d3c37b
6 changed files with 166 additions and 6 deletions

View File

@ -1008,12 +1008,12 @@ func (cmd *StringStringMapCmd) String() string {
// Scan scans the results from the map into a destination struct. The map keys
// are matched in the Redis struct fields by the `redis:"field"` tag.
func (cmd *StringStringMapCmd) Scan(dst interface{}) error {
func (cmd *StringStringMapCmd) Scan(dest interface{}) error {
if cmd.err != nil {
return cmd.err
}
strct, err := hscan.Struct(dst)
strct, err := hscan.Struct(dest)
if err != nil {
return err
}