mirror of
https://github.com/fluxcd/flux2.git
synced 2025-10-29 23:37:47 +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
|
||||
if keyID != "" {
|
||||
if strings.HasPrefix(keyID, "0x") {
|
||||
keyID = strings.TrimPrefix(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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user