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"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
@@ -76,7 +77,7 @@ func (ssh_conf *MakeConfig) connect() (*ssh.Session, error) {
|
|||||||
Auth: auths,
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user