update connectErr err to panic for multiple hosts

This commit is contained in:
CyberShell committed 2023-01-02 12:28:33 -06:00
1 parent 42034a7c15
commit a5f4ba3c2a
3 files changed
+29 -48

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) {
for _, host := range remoteConfig.HostName {
sshConnection, connectErr = ssh.Dial("tcp", host, sshConfig)
if connectErr != nil {
continue
panic(fmt.Errorf("error when connecting to host %s: %w", host, connectErr))
}
}
break