From 87fcf060aacae7a72e7674a6a83b4a5166f120c5 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 30 Jan 2017 00:46:53 +0800 Subject: [PATCH] refactor: update ssh host using JoinHostPort --- easyssh/easyssh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easyssh/easyssh.go b/easyssh/easyssh.go index b0f4eab..157cd36 100644 --- a/easyssh/easyssh.go +++ b/easyssh/easyssh.go @@ -83,7 +83,7 @@ func (ssh_conf *MakeConfig) connect() (*ssh.Session, error) { Auth: auths, } - client, err := ssh.Dial("tcp", ssh_conf.Server+":"+ssh_conf.Port, config) + client, err := ssh.Dial("tcp", net.JoinHostPort(ssh_conf.Server, ssh_conf.Port), config) if err != nil { return nil, err }