func (it *ScanIterator) Next() bool {
	it.mu.Lock()
	defer it.mu.Unlock()
	if it.cmd.Err() != nil {
		return false
	}
	if it.pos < len(it.cmd.page) {
		it.pos++
		return true
	}
	for {
		if it.cmd.cursor == 0 {
			return false
		}
		if it.cmd._args[0] == "scan" {
			it.cmd._args[1] = it.cmd.cursor
		} else {
			it.cmd._args[2] = it.cmd.cursor
		}
		err := it.cmd.process(it.cmd)
		if err != nil {
			return false
		}
		it.pos = 1
		if len(it.cmd.page) > 0 {
			return true
		}
	}
}
Next advances the cursor and returns true if more values can be read.
package redis
import "sync"
type ScanIterator struct {
	mu  sync.Mutex  
	cmd *ScanCmd
	pos int
}
func (it *ScanIterator) Err() error {
	it.mu.Lock()
	err := it.cmd.Err()
	it.mu.Unlock()
	return err
}