mirror of
https://github.com/fluxcd/flux2.git
synced 2025-11-01 10:12:51 +08:00
misc: unconditional strings.TrimPrefix
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
@ -465,9 +465,7 @@ func getOpenPgpEntity(keyRing openpgp.EntityList, passphrase, keyID string) (*op
|
|||||||
|
|
||||||
var entity *openpgp.Entity
|
var entity *openpgp.Entity
|
||||||
if keyID != "" {
|
if keyID != "" {
|
||||||
if strings.HasPrefix(keyID, "0x") {
|
keyID = strings.TrimPrefix(keyID, "0x")
|
||||||
keyID = strings.TrimPrefix(keyID, "0x")
|
|
||||||
}
|
|
||||||
if len(keyID) != 16 {
|
if len(keyID) != 16 {
|
||||||
return nil, fmt.Errorf("invalid GPG key id length; expected %d, got %d", 16, len(keyID))
|
return nil, fmt.Errorf("invalid GPG key id length; expected %d, got %d", 16, len(keyID))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user