Skip to content

Commit

Permalink
avoid needless mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsullivan committed Aug 3, 2022
1 parent 42065d2 commit e01d337
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions befehl.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ func (instance *Instance) Fire(hostsFile, payload string, routines int) error {
}

func (instance *Instance) getPrivKeyFile() string {
privKeyFile := os.Getenv("HOME") + "/.ssh/id_rsa"
if instance.options.PrivateKeyFile != "" {
privKeyFile = instance.options.PrivateKeyFile
return instance.options.PrivateKeyFile
}

return privKeyFile
return os.Getenv("HOME") + "/.ssh/id_rsa"
}

func (instance *Instance) populateSshKeyEncrypted(privKeyBytes *pem.Block) error {
Expand Down

0 comments on commit e01d337

Please sign in to comment.