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

Scan: swap return values and change cursor type.

This commit is contained in:
Vladimir Mihailenco
2016-04-09 13:07:42 +03:00
parent 2add1e06fb
commit 38be24b025
5 changed files with 25 additions and 27 deletions

View File

@ -693,8 +693,8 @@ func (cmd *ZSliceCmd) readReply(cn *pool.Conn) error {
type ScanCmd struct {
baseCmd
cursor int64
page []string
cursor uint64
}
func NewScanCmd(args ...interface{}) *ScanCmd {
@ -709,14 +709,12 @@ func (cmd *ScanCmd) reset() {
cmd.err = nil
}
// TODO: swap return values
func (cmd *ScanCmd) Val() (int64, []string) {
return cmd.cursor, cmd.page
func (cmd *ScanCmd) Val() (keys []string, cursor uint64) {
return cmd.page, cmd.cursor
}
func (cmd *ScanCmd) Result() (int64, []string, error) {
return cmd.cursor, cmd.page, cmd.err
func (cmd *ScanCmd) Result() (keys []string, cursor uint64, err error) {
return cmd.page, cmd.cursor, cmd.err
}
func (cmd *ScanCmd) String() string {