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.
(dst interface{})
| 1026 | // Scan scans the results from the map into a destination struct. The map keys |
| 1027 | // are matched in the Redis struct fields by the `redis:"field"` tag. |
| 1028 | func (cmd *SliceCmd) Scan(dst interface{}) error { |
| 1029 | if cmd.err != nil { |
| 1030 | return cmd.err |
| 1031 | } |
| 1032 | |
| 1033 | // Pass the list of keys and values. |
| 1034 | // Skip the first two args for: HMGET key |
| 1035 | var args []interface{} |
| 1036 | if cmd.args[0] == "hmget" { |
| 1037 | args = cmd.args[2:] |
| 1038 | } else { |
| 1039 | // Otherwise, it's: MGET field field ... |
| 1040 | args = cmd.args[1:] |
| 1041 | } |
| 1042 | |
| 1043 | return hscan.Scan(dst, args, cmd.val) |
| 1044 | } |
| 1045 | |
| 1046 | func (cmd *SliceCmd) readReply(rd *proto.Reader) (err error) { |
| 1047 | cmd.val, err = rd.ReadSlice() |