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