diff --git a/azkv/keysource.go b/azkv/keysource.go index 11e761026..28cb6ebde 100644 --- a/azkv/keysource.go +++ b/azkv/keysource.go @@ -79,7 +79,7 @@ func NewMasterKeyFromURL(url string) (*MasterKey, error) { url = strings.TrimSpace(url) re := regexp.MustCompile("^(https://[^/]+)/keys/([^/]+)/([^/]+)$") parts := re.FindStringSubmatch(url) - if parts == nil || len(parts) < 3 { + if len(parts) < 3 { return nil, fmt.Errorf("could not parse %q into a valid Azure Key Vault MasterKey", url) } return NewMasterKey(parts[1], parts[2], parts[3]), nil diff --git a/cmd/sops/common/common.go b/cmd/sops/common/common.go index 1bf6dc026..6d6fa0751 100644 --- a/cmd/sops/common/common.go +++ b/cmd/sops/common/common.go @@ -222,7 +222,7 @@ func GetKMSKeyWithEncryptionCtx(tree *sops.Tree) (keyGroupIndex int, keyIndex in for n, k := range kg { kmsKey, ok := k.(*kms.MasterKey) if ok { - if kmsKey.EncryptionContext != nil && len(kmsKey.EncryptionContext) >= 2 { + if len(kmsKey.EncryptionContext) >= 2 { duplicateValues := map[string]int{} for _, v := range kmsKey.EncryptionContext { duplicateValues[*v] = duplicateValues[*v] + 1