Skip to content

Commit

Permalink
Merge pull request #249 from arnested/codestyle
Browse files Browse the repository at this point in the history
Fix codestyle issue
  • Loading branch information
arnested authored Apr 5, 2024
2 parents daca924 + 546fc83 commit f5fa11a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/sshkeygen/sshkeygen.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ func Collect(hostname string) {
var sshfpRecord SshfpRecord

//nolint:gomnd
s := strings.SplitN(key, " ", 6)
keyParts := strings.SplitN(key, " ", 6)
//nolint:gomnd
if len(s) != 6 {
if len(keyParts) != 6 {
log.Printf("unexpected number of fields in ssh-keygen output: %q", key)

continue
}

sshfpRecord.Name, sshfpRecord.Algorithm, sshfpRecord.FingerprintType, sshfpRecord.Fingerprint = s[0], s[3], s[4], s[5]
sshfpRecord.Name = keyParts[0]
sshfpRecord.Algorithm = keyParts[3]
sshfpRecord.FingerprintType = keyParts[4]
sshfpRecord.Fingerprint = keyParts[5]

SshfpRecords[sshfpRecord.Algorithm+" "+sshfpRecord.FingerprintType+" "+sshfpRecord.Fingerprint] = sshfpRecord
}
}

0 comments on commit f5fa11a

Please sign in to comment.