From 9073e4056de44fe547b4a84840f868165f2f414a Mon Sep 17 00:00:00 2001 From: rouzier Date: Sun, 17 Dec 2023 10:43:21 -0500 Subject: [PATCH] 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> --- README.md | 9 +++++---- example/lua-scripting/go.mod | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b08330df..98edbe21 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/example/lua-scripting/go.mod b/example/lua-scripting/go.mod index 97416d41..a19f0ab1 100644 --- a/example/lua-scripting/go.mod +++ b/example/lua-scripting/go.mod @@ -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