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

Add scan iterator.

This commit is contained in:
Dimitrij Denissenko
2016-04-13 09:52:47 +01:00
committed by Vladimir Mihailenco
parent 889409de38
commit 7456a0e473
6 changed files with 216 additions and 18 deletions

View File

@ -314,3 +314,23 @@ func Example_customCommand() {
fmt.Printf("%q %s", v, err)
// Output: "" redis: nil
}
func ExampleScanIterator() {
iter := client.Scan(0, "", 0).Iterator()
for iter.Next() {
fmt.Println(iter.Val())
}
if err := iter.Err(); err != nil {
panic(err)
}
}
func ExampleScanCmd_Iterator() {
iter := client.Scan(0, "", 0).Iterator()
for iter.Next() {
fmt.Println(iter.Val())
}
if err := iter.Err(); err != nil {
panic(err)
}
}