@@ -100,31 +100,31 @@ hashFields := []string{
100100 " price" , " 4972" ,
101101}
102102
103- res1 , err := rdb .HSet (ctx, " bike:1" , hashFields).Result ()
103+ res1 , err := client .HSet (ctx, " bike:1" , hashFields).Result ()
104104
105105if err != nil {
106106 panic (err)
107107}
108108
109109fmt.Println (res1) // >>> 4
110110
111- res2 , err := rdb .HGet (ctx, " bike:1" , " model" ).Result ()
111+ res2 , err := client .HGet (ctx, " bike:1" , " model" ).Result ()
112112
113113if err != nil {
114114 panic (err)
115115}
116116
117117fmt.Println (res2) // >>> Deimos
118118
119- res3 , err := rdb .HGet (ctx, " bike:1" , " price" ).Result ()
119+ res3 , err := client .HGet (ctx, " bike:1" , " price" ).Result ()
120120
121121if err != nil {
122122 panic (err)
123123}
124124
125125fmt.Println (res3) // >>> 4972
126126
127- res4 , err := rdb .HGetAll (ctx, " bike:1" ).Result ()
127+ res4 , err := client .HGetAll (ctx, " bike:1" ).Result ()
128128
129129if err != nil {
130130 panic (err)
@@ -148,7 +148,7 @@ type BikeInfo struct {
148148}
149149
150150var res4a BikeInfo
151- err = rdb .HGetAll (ctx, " bike:1" ).Scan (&res4a)
151+ err = client .HGetAll (ctx, " bike:1" ).Scan (&res4a)
152152
153153if err != nil {
154154 panic (err)
@@ -171,15 +171,15 @@ import (
171171 " github.com/redis/go-redis/extra/redisotel/v9"
172172)
173173
174- rdb := redis.NewClient (&redis.Options {...})
174+ client := redis.NewClient (&redis.Options {...})
175175
176176// Enable tracing instrumentation.
177- if err := redisotel.InstrumentTracing (rdb ); err != nil {
177+ if err := redisotel.InstrumentTracing (client ); err != nil {
178178 panic (err)
179179}
180180
181181// Enable metrics instrumentation.
182- if err := redisotel.InstrumentMetrics (rdb ); err != nil {
182+ if err := redisotel.InstrumentMetrics (client ); err != nil {
183183 panic (err)
184184}
185185```
0 commit comments