Update docs and examples (#2806)

* Fix example 'Connecting via a redis url' and make it compile

* Fix name of example

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
This commit is contained in:
rouzier 2023-12-17 10:43:21 -05:00 committed by GitHub
parent c828764336
commit 9073e4056d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -149,15 +149,16 @@ import (
"github.com/redis/go-redis/v9"
)
var ctx = context.Background()
func ExampleClient() {
func ExampleClient() *redis.Client {
url := "redis://user:password@localhost:6379/0?protocol=3"
opts, err := redis.ParseURL(url)
if err != nil {
panic(err)
}
rdb := redis.NewClient(opts)
return redis.NewClient(opts)
}
```
## Contributing

View File

@ -1,4 +1,4 @@
module github.com/redis/go-redis/example/redis-bloom
module github.com/redis/go-redis/example/lua-scripting
go 1.18