mirror of https://github.com/go-redis/redis.git
Fix error message for Go 1.8.
This commit is contained in:
parent
3b87351e3f
commit
8ddd2beaee
|
@ -3,6 +3,7 @@ package redis
|
|||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
@ -151,7 +152,7 @@ func ParseURL(redisURL string) (*Options, error) {
|
|||
o.DB = 0
|
||||
case 1:
|
||||
if o.DB, err = strconv.Atoi(f[0]); err != nil {
|
||||
return nil, errors.New("invalid redis database number: " + err.Error())
|
||||
return nil, fmt.Errorf("invalid redis database number: %q", f[0])
|
||||
}
|
||||
default:
|
||||
return nil, errors.New("invalid redis URL path: " + u.Path)
|
||||
|
|
|
@ -63,7 +63,7 @@ func TestParseURL(t *testing.T) {
|
|||
{
|
||||
"redis://localhost/iamadatabase",
|
||||
"",
|
||||
0, false, errors.New("invalid redis database number: strconv.ParseInt: parsing \"iamadatabase\": invalid syntax"),
|
||||
0, false, errors.New(`invalid redis database number: "iamadatabase"`),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue