mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-02-05 09:10:09 +08:00
refactor: update ssh host using JoinHostPort
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -76,7 +77,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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user