Skip to content

Commit

Permalink
fix ineffectual assignment error
Browse files Browse the repository at this point in the history
  • Loading branch information
dopey committed Nov 16, 2018
1 parent 93aa6d6 commit 5db90e2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions command/crypto/key/format.go
Expand Up @@ -105,6 +105,9 @@ func formatAction(ctx *cli.Context) error {
default:
return errors.Errorf("Unsupoorted key type %T", key)
}
if err != nil {
return err
}
default: // assuming DER format
// Attempt to parse first as a PKCS8 formatted private key.
key, err := x509.ParsePKCS8PrivateKey(b)
Expand All @@ -124,10 +127,6 @@ func formatAction(ctx *cli.Context) error {
ob = pem.EncodeToMemory(p)
}

if err != nil {
return err
}

if out == "" {
os.Stdout.Write(ob)
} else {
Expand Down

0 comments on commit 5db90e2

Please sign in to comment.