Skip to content

Commit 05cc02a

Browse files
committed
Add support for iter.Seq for ScanIterator
1 parent e191cf9 commit 05cc02a

File tree

17 files changed

+124
-27
lines changed

17 files changed

+124
-27
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ In `go-redis` we are aiming to support the last three releases of Redis. Current
1515
- [Redis 7.4](https://raw.githubusercontent.com/redis/redis/7.4/00-RELEASENOTES) - using Redis Stack 7.4 for modules support
1616
- [Redis 8.0](https://raw.githubusercontent.com/redis/redis/8.0/00-RELEASENOTES) - using Redis CE 8.0 where modules are included
1717

18-
Although the `go.mod` states it requires at minimum `go 1.18`, our CI is configured to run the tests against all three
18+
Although the `go.mod` states it requires at minimum `go 1.23`, our CI is configured to run the tests against all three
1919
versions of Redis and latest two versions of Go ([1.23](https://go.dev/doc/devel/release#go1.23.0),
2020
[1.24](https://go.dev/doc/devel/release#go1.24.0)). We observe that some modules related test may not pass with
2121
Redis Stack 7.2 and some commands are changed with Redis CE 8.0.

example/del-keys-without-ttl/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redis/go-redis/example/del-keys-without-ttl
22

3-
go 1.18
3+
go 1.23
44

55
replace github.com/redis/go-redis/v9 => ../..
66

example/del-keys-without-ttl/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func main() {
2828
checker.Start(ctx)
2929

3030
iter := rdb.Scan(ctx, 0, "", 0).Iterator()
31-
for iter.Next(ctx) {
32-
checker.Add(iter.Val())
31+
for val := range iter.Vals(ctx) {
32+
checker.Add(val)
3333
}
3434
if err := iter.Err(); err != nil {
3535
panic(err)

example/hll/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redis/go-redis/example/hll
22

3-
go 1.18
3+
go 1.23
44

55
replace github.com/redis/go-redis/v9 => ../..
66

example/hset-struct/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redis/go-redis/example/scan-struct
22

3-
go 1.18
3+
go 1.23
44

55
replace github.com/redis/go-redis/v9 => ../..
66

example/lua-scripting/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redis/go-redis/example/lua-scripting
22

3-
go 1.18
3+
go 1.23
44

55
replace github.com/redis/go-redis/v9 => ../..
66

example/redis-bloom/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redis/go-redis/example/redis-bloom
22

3-
go 1.18
3+
go 1.23
44

55
replace github.com/redis/go-redis/v9 => ../..
66

example/scan-struct/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redis/go-redis/example/scan-struct
22

3-
go 1.18
3+
go 1.23
44

55
replace github.com/redis/go-redis/v9 => ../..
66

example_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,8 @@ func Example_customCommand2() {
632632

633633
func ExampleScanIterator() {
634634
iter := rdb.Scan(ctx, 0, "", 0).Iterator()
635-
for iter.Next(ctx) {
636-
fmt.Println(iter.Val())
635+
for val := range iter.Vals(ctx) {
636+
fmt.Println(val)
637637
}
638638
if err := iter.Err(); err != nil {
639639
panic(err)
@@ -642,8 +642,8 @@ func ExampleScanIterator() {
642642

643643
func ExampleScanCmd_Iterator() {
644644
iter := rdb.Scan(ctx, 0, "", 0).Iterator()
645-
for iter.Next(ctx) {
646-
fmt.Println(iter.Val())
645+
for val := range iter.Vals(ctx) {
646+
fmt.Println(val)
647647
}
648648
if err := iter.Err(); err != nil {
649649
panic(err)

extra/rediscensus/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/redis/go-redis/extra/rediscensus/v9
22

3-
go 1.19
3+
go 1.23
44

55
replace github.com/redis/go-redis/v9 => ../..
66

0 commit comments

Comments
 (0)