@@ -100,31 +100,31 @@ hashFields := []string{
100
100
" price" , " 4972" ,
101
101
}
102
102
103
- res1 , err := rdb .HSet (ctx, " bike:1" , hashFields).Result ()
103
+ res1 , err := client .HSet (ctx, " bike:1" , hashFields).Result ()
104
104
105
105
if err != nil {
106
106
panic (err)
107
107
}
108
108
109
109
fmt.Println (res1) // >>> 4
110
110
111
- res2 , err := rdb .HGet (ctx, " bike:1" , " model" ).Result ()
111
+ res2 , err := client .HGet (ctx, " bike:1" , " model" ).Result ()
112
112
113
113
if err != nil {
114
114
panic (err)
115
115
}
116
116
117
117
fmt.Println (res2) // >>> Deimos
118
118
119
- res3 , err := rdb .HGet (ctx, " bike:1" , " price" ).Result ()
119
+ res3 , err := client .HGet (ctx, " bike:1" , " price" ).Result ()
120
120
121
121
if err != nil {
122
122
panic (err)
123
123
}
124
124
125
125
fmt.Println (res3) // >>> 4972
126
126
127
- res4 , err := rdb .HGetAll (ctx, " bike:1" ).Result ()
127
+ res4 , err := client .HGetAll (ctx, " bike:1" ).Result ()
128
128
129
129
if err != nil {
130
130
panic (err)
@@ -148,7 +148,7 @@ type BikeInfo struct {
148
148
}
149
149
150
150
var res4a BikeInfo
151
- err = rdb .HGetAll (ctx, " bike:1" ).Scan (&res4a)
151
+ err = client .HGetAll (ctx, " bike:1" ).Scan (&res4a)
152
152
153
153
if err != nil {
154
154
panic (err)
@@ -171,15 +171,15 @@ import (
171
171
" github.com/redis/go-redis/extra/redisotel/v9"
172
172
)
173
173
174
- rdb := redis.NewClient (&redis.Options {...})
174
+ client := redis.NewClient (&redis.Options {...})
175
175
176
176
// Enable tracing instrumentation.
177
- if err := redisotel.InstrumentTracing (rdb ); err != nil {
177
+ if err := redisotel.InstrumentTracing (client ); err != nil {
178
178
panic (err)
179
179
}
180
180
181
181
// Enable metrics instrumentation.
182
- if err := redisotel.InstrumentMetrics (rdb ); err != nil {
182
+ if err := redisotel.InstrumentMetrics (client ); err != nil {
183
183
panic (err)
184
184
}
185
185
```
0 commit comments