@@ -206,7 +206,7 @@ func ParseURL(redisURL string) (*Options, error) {
206
206
case "unix" :
207
207
return setupUnixConn (u )
208
208
default :
209
- return nil , fmt .Errorf ("invalid redis URL scheme: %s" , u .Scheme )
209
+ return nil , fmt .Errorf ("redis: invalid URL scheme: %s" , u .Scheme )
210
210
}
211
211
}
212
212
@@ -216,7 +216,7 @@ func setupTCPConn(u *url.URL) (*Options, error) {
216
216
o .Username , o .Password = getUserPassword (u )
217
217
218
218
if len (u .Query ()) > 0 {
219
- return nil , errors .New ("no options supported" )
219
+ return nil , errors .New ("redis: no options supported" )
220
220
}
221
221
222
222
h , p , err := net .SplitHostPort (u .Host )
@@ -239,10 +239,10 @@ func setupTCPConn(u *url.URL) (*Options, error) {
239
239
o .DB = 0
240
240
case 1 :
241
241
if o .DB , err = strconv .Atoi (f [0 ]); err != nil {
242
- return nil , fmt .Errorf ("invalid redis database number: %q" , f [0 ])
242
+ return nil , fmt .Errorf ("redis: invalid database number: %q" , f [0 ])
243
243
}
244
244
default :
245
- return nil , fmt .Errorf ("invalid redis URL path: %s" , u .Path )
245
+ return nil , fmt .Errorf ("redis: invalid URL path: %s" , u .Path )
246
246
}
247
247
248
248
if u .Scheme == "rediss" {
@@ -258,7 +258,7 @@ func setupUnixConn(u *url.URL) (*Options, error) {
258
258
}
259
259
260
260
if strings .TrimSpace (u .Path ) == "" { // path is required with unix connection
261
- return nil , errors .New ("empty redis unix socket path" )
261
+ return nil , errors .New ("redis: empty unix socket path" )
262
262
}
263
263
o .Addr = u .Path
264
264
@@ -268,9 +268,10 @@ func setupUnixConn(u *url.URL) (*Options, error) {
268
268
if dbStr == "" {
269
269
return o , nil // if database is not set, connect to 0 db.
270
270
}
271
+
271
272
db , err := strconv .Atoi (dbStr )
272
273
if err != nil {
273
- return nil , fmt .Errorf ("invalid reids database number: %s" , err )
274
+ return nil , fmt .Errorf ("redis: invalid database number: %s" , err )
274
275
}
275
276
o .DB = db
276
277
0 commit comments