From d701d269384b1b7caa55aca595198b49a38c04b3 Mon Sep 17 00:00:00 2001 From: Andrew Woodlee Date: Mon, 2 Jan 2023 12:04:00 -0600 Subject: [PATCH] changes in wording --- pkg/backy/backy.go | 6 +++--- pkg/backy/ssh.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/backy/backy.go b/pkg/backy/backy.go index 8d2910c..72aefd2 100644 --- a/pkg/backy/backy.go +++ b/pkg/backy/backy.go @@ -59,12 +59,12 @@ func (command Command) runCmd() logging.Logging { remoteHost.Port = 22 remoteHost.Host = command.RemoteHost.Host - sshc, err := remoteHost.ConnectToSSHHost() + sshConnection, err := remoteHost.ConnectToSSHHost() if err != nil { panic(fmt.Errorf("ssh dial: %w", err)) } - defer sshc.Close() - s, err := sshc.NewSession() + defer sshConnection.Close() + s, err := sshConnection.NewSession() if err != nil { panic(fmt.Errorf("new ssh session: %w", err)) } diff --git a/pkg/backy/ssh.go b/pkg/backy/ssh.go index 31c1aa5..506e58b 100644 --- a/pkg/backy/ssh.go +++ b/pkg/backy/ssh.go @@ -51,7 +51,7 @@ func (config SshConfig) GetSSHConfig() (SshConfig, error) { func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) { - var sshc *ssh.Client + var sshConnection *ssh.Client var connectErr error f, _ := os.Open(filepath.Join(os.Getenv("HOME"), ".ssh", "config")) @@ -104,14 +104,14 @@ func (remoteConfig *Host) ConnectToSSHHost() (*ssh.Client, error) { HostKeyCallback: ssh.InsecureIgnoreHostKey(), } for _, host := range remoteConfig.HostName { - sshc, connectErr = ssh.Dial("tcp", host, sshConfig) + sshConnection, connectErr = ssh.Dial("tcp", host, sshConfig) if connectErr != nil { - continue + break } } break } } - return sshc, connectErr + return sshConnection, connectErr }