]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
rpc: replace append to sshOpts with assignment in DialSSH()
authorSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 17:51:02 +0000 (19:51 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 17:51:02 +0000 (19:51 +0200)
sshOpts is empty by default and assigned only once. Don't suggest that
this line is supposed to add to an existing value.

rpc/dial.go

index 0782ab08e617933e4e2c369651253d11324e355f..909ec7e1aaf7e70193af9e05d29cbbdd07769f79 100644 (file)
@@ -51,7 +51,7 @@ func (c *Conn) DialSSH(user, host, sshConfig string) error {
 
        c.sshRemote = remote
        if sshConfig != "" {
-               c.sshOpts = append(c.sshOpts, "-F", sshConfig)
+               c.sshOpts = []string{"-F", sshConfig}
        }
        c.cmd = exec.Command("ssh",
                append(append([]string{}, c.sshOpts...),