Skip to content

Commit 9073e40

Browse files
rouzierofekshenawa
andauthored
Update docs and examples (#2806)
* Fix example 'Connecting via a redis url' and make it compile * Fix name of example --------- Co-authored-by: ofekshenawa <[email protected]>
1 parent c828764 commit 9073e40

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,16 @@ import (
149149
"github.com/redis/go-redis/v9"
150150
)
151151

152-
var ctx = context.Background()
153-
154-
func ExampleClient() {
152+
func ExampleClient() *redis.Client {
155153
url := "redis://user:password@localhost:6379/0?protocol=3"
156154
opts, err := redis.ParseURL(url)
157155
if err != nil {
158156
panic(err)
159157
}
160-
rdb := redis.NewClient(opts)
158+
159+
return redis.NewClient(opts)
160+
}
161+
161162
```
162163

163164
## Contributing

example/lua-scripting/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/redis/go-redis/example/redis-bloom
1+
module github.com/redis/go-redis/example/lua-scripting
22

33
go 1.18
44

0 commit comments

Comments
 (0)