mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-08 00:37:27 +00:00
misc: unconditional strings.TrimPrefix
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
parent
5b22207c98
commit
ce3e264c7d
1 changed files with 1 additions and 3 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue