Redis: Error: dial tcp: address http://localhost:6379: too many colons in address

Created on 12 Sep 2018  路  4Comments  路  Source: go-redis/redis

client := redis.NewClient(&redis.Options{ Addr: "http://localhost:6379, Password: "", DB: 0, }) pong, err := client.Ping().Result()

err = dial tcp: address http://localhost:6379: too many colons in address

Can anyone explain why this is happening?

Most helpful comment

Replace http://localhost:6379 with localhost:6379. http:// is meaningless in this context.

All 4 comments

Replace http://localhost:6379 with localhost:6379. http:// is meaningless in this context.

I get the similar error with redis url

redis://h:[email protected]:38799

+1

Was this page helpful?
0 / 5 - 0 ratings