From 41fe4a4659d50d70a835224405490588019d24ff Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 25 Jan 2024 00:39:14 -0600 Subject: new home Signed-off-by: Jeff Carr --- ssh.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'ssh.go') diff --git a/ssh.go b/ssh.go index 7882ada..67b5c22 100644 --- a/ssh.go +++ b/ssh.go @@ -5,23 +5,23 @@ import ( "io/ioutil" "time" - "golang.org/x/crypto/ssh" "github.com/tmc/scp" "go.wit.com/log" + "golang.org/x/crypto/ssh" ) var sshHostname string -var sshPort int -var sshUsername string -var sshPassword string -var sshKeyfile string +var sshPort int +var sshUsername string +var sshPassword string +var sshKeyfile string func SSHclientSet(hostname string, port int, username string, pass string, keyfile string) { - sshHostname = hostname - sshPort = port - sshUsername = username - sshPassword = pass - sshKeyfile = keyfile + sshHostname = hostname + sshPort = port + sshUsername = username + sshPassword = pass + sshKeyfile = keyfile } func SSHclientSCP(localfile string, remotefile string) { @@ -49,7 +49,7 @@ func mySsh(hostname string, port int, username string, pass string, keyfile stri // log.Log(SSH, "hostkey =", hostKey) publicKey, err := PublicKeyFile(keyfile) - if (err != nil) { + if err != nil { log.Log(SSH, "PublicKeyFile() error =", err) } @@ -75,7 +75,7 @@ func mySsh(hostname string, port int, username string, pass string, keyfile stri ssh.KeyAlgoED25519, }, // optional tcp connect timeout - Timeout: 5 * time.Second, + Timeout: 5 * time.Second, } sport := fmt.Sprintf("%d", port) -- cgit v1.2.3