misc: unconditional `strings.TrimPrefix`

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
pull/4329/head
Hidde Beydals 1 year ago
parent 5b22207c98
commit ce3e264c7d
No known key found for this signature in database
GPG Key ID: 979F380FC2341744

@ -465,9 +465,7 @@ func getOpenPgpEntity(keyRing openpgp.EntityList, passphrase, keyID string) (*op
var entity *openpgp.Entity
if keyID != "" {
if strings.HasPrefix(keyID, "0x") {
keyID = strings.TrimPrefix(keyID, "0x")
}
if len(keyID) != 16 {
return nil, fmt.Errorf("invalid GPG key id length; expected %d, got %d", 16, len(keyID))
}

Loading…
Cancel
Save