Skip to content

Commit 45ccb24

Browse files
committed
Update readme
1 parent e1b0a0b commit 45ccb24

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

README.md

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
> :heart: [**Uptrace.dev** - distributed traces, logs, and errors in one place](https://uptrace.dev)
99
10-
- [Docs](https://redis.uptrace.dev)
10+
- Join [Discord](https://discord.gg/rWtp5Aj) to ask questions.
11+
- [Documentation](https://redis.uptrace.dev)
1112
- [Reference](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc)
1213
- [Examples](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#pkg-examples)
1314
- [RealWorld example app](https://github.com/uptrace/go-treemux-realworld-example-app)
14-
- Join [Discord](https://discord.gg/rWtp5Aj) to ask questions.
1515

1616
## Ecosystem
1717

@@ -40,18 +40,18 @@
4040

4141
## Installation
4242

43-
go-redis requires a Go version with [Modules](https://github.com/golang/go/wiki/Modules) support and
44-
uses import versioning. So please make sure to initialize a Go module before installing go-redis:
43+
go-redis supports 2 last Go versions and requires a Go version with
44+
[modules](https://github.com/golang/go/wiki/Modules) support. So make sure to initialize a Go
45+
module:
4546

4647
```shell
4748
go mod init github.com/my/repo
48-
go get github.com/go-redis/redis/v8
4949
```
5050

51-
Import:
51+
And then install go-redis (note _v8_ in the import; omitting it is a popular mistake):
5252

53-
```go
54-
import "github.com/go-redis/redis/v8"
53+
```shell
54+
go get github.com/go-redis/redis/v8
5555
```
5656

5757
## Quickstart
@@ -64,24 +64,13 @@ import (
6464

6565
var ctx = context.Background()
6666

67-
func ExampleNewClient() {
68-
rdb := redis.NewClient(&redis.Options{
69-
Addr: "localhost:6379",
70-
Password: "", // no password set
71-
DB: 0, // use default DB
72-
})
73-
74-
pong, err := rdb.Ping(ctx).Result()
75-
fmt.Println(pong, err)
76-
// Output: PONG <nil>
77-
}
78-
7967
func ExampleClient() {
8068
rdb := redis.NewClient(&redis.Options{
8169
Addr: "localhost:6379",
8270
Password: "", // no password set
8371
DB: 0, // use default DB
8472
})
73+
8574
err := rdb.Set(ctx, "key", "value", 0).Err()
8675
if err != nil {
8776
panic(err)
@@ -106,11 +95,6 @@ func ExampleClient() {
10695
}
10796
```
10897

109-
## Howto
110-
111-
Please go through [examples](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#pkg-examples)
112-
to get an idea how to use this package.
113-
11498
## Look and feel
11599

116100
Some corner cases:

0 commit comments

Comments
 (0)