redis: support IPv6 addresses with no port

closes #356
This commit is contained in:
Nicholas Katsaros
2015-11-09 21:56:28 -05:00
committed by Cameron Sparr
parent 1accab02ed
commit 2af97cdbcb
2 changed files with 2 additions and 1 deletions

View File

@@ -114,7 +114,7 @@ const defaultPort = "6379"
func (r *Redis) gatherServer(addr *url.URL, acc plugins.Accumulator) error {
_, _, err := net.SplitHostPort(addr.Host)
if err != nil {
addr.Host = addr.Host + ":" + defaultPort
addr.Host = net.JoinHostPort(addr.Host, defaultPort)
}
c, err := net.Dial("tcp", addr.Host)