Skip to content

Commit

Permalink
Fixed CILint Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
racerxdl committed May 13, 2019
1 parent 55db95d commit cc0b8b5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cmd/standalone/cmdimport.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ func ImportKey(filename, keyPassword string, keyPasswordFd int) {
private, err := pgpMan.GetPrivateKeyAscii(v, keyPassword)

if err == nil {
pgpMan.SaveKey(v, private, keyPassword)
fmt.Fprintf(os.Stderr, "Imported private key %s\n", v)
continue
err = pgpMan.SaveKey(v, private, keyPassword)
if err == nil {
fmt.Fprintf(os.Stderr, "Imported private key %s\n", v)
continue
}
}

fmt.Fprintf(os.Stderr, "Cannot import private key %s with supplied password: %s\n", v, err)
Expand All @@ -81,9 +83,11 @@ func ImportKey(filename, keyPassword string, keyPasswordFd int) {
// Try public if no private
public, err := pgpMan.GetPublicKeyAscii(v)
if err == nil {
fmt.Fprintf(os.Stderr, "Imported public key %s\n", v)
pgpMan.SaveKey(v, public, nil)
continue
err = pgpMan.SaveKey(v, public, nil)
if err == nil {
fmt.Fprintf(os.Stderr, "Imported public key %s\n", v)
continue
}
}

fmt.Fprintf(os.Stderr, "Cannot import public key %s: %s\n", v, err)
Expand Down

0 comments on commit cc0b8b5

Please sign in to comment.