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?
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
Most helpful comment
Replace
http://localhost:6379withlocalhost:6379.http://is meaningless in this context.