Skip to content

Commit

Permalink
refactor(SSH): rename cli param to avoid confussion about what is bei…
Browse files Browse the repository at this point in the history
…ng executed
  • Loading branch information
henrybarreto committed Sep 4, 2023
1 parent 835df5f commit fe59912
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,19 @@ func CanCreateSSHConnection(address, username, password string, config *Config)
}

// ExecuteSSHCommand executes a command to an address using the SSH protocol.
func ExecuteSSHCommand(cli *ssh.Client, body string, config *Config) (bool, int, error) {
func ExecuteSSHCommand(sshClient *ssh.Client, body string, config *Config) (bool, int, error) {
type Body struct {
Command string `json:"command"`
}

defer cli.Close()
defer sshClient.Close()

var b Body
if err := json.Unmarshal([]byte(body), &b); err != nil {
return false, 0, err
}

sess, err := cli.NewSession()
sess, err := sshClient.NewSession()
if err != nil {
return false, 0, err
}
Expand Down

0 comments on commit fe59912

Please sign in to comment.