Skip to content

Commit

Permalink
Update docs and examples (#2806)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
rouzier and ofekshenawa committed Dec 17, 2023
1 parent c828764 commit 9073e40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/lua-scripting/go.mod
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 9073e40

Please sign in to comment.