mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
refactor: update ssh host using JoinHostPort
This commit is contained in:
parent
b704ba55cb
commit
a8cc62009f
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user