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.
(dest interface{})
| 2165 | // Scan scans the results from the map into a destination struct. The map keys |
| 2166 | // are matched in the Redis struct fields by the `redis:"field"` tag. |
| 2167 | func (cmd *MapStringStringCmd) Scan(dest interface{}) error { |
| 2168 | if cmd.err != nil { |
| 2169 | return cmd.err |
| 2170 | } |
| 2171 | |
| 2172 | strct, err := hscan.Struct(dest) |
| 2173 | if err != nil { |
| 2174 | return err |
| 2175 | } |
| 2176 | |
| 2177 | for k, v := range cmd.val { |
| 2178 | if err := strct.Scan(k, v); err != nil { |
| 2179 | return err |
| 2180 | } |
| 2181 | } |
| 2182 | |
| 2183 | return nil |
| 2184 | } |
| 2185 | |
| 2186 | func (cmd *MapStringStringCmd) readReply(rd *proto.Reader) error { |
| 2187 | n, err := rd.ReadMapLen() |