mirror of https://github.com/go-redis/redis.git
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:
parent
c828764336
commit
9073e4056d
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue